1#![doc = "MAVLink paparazzi dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
10#[allow(unused_imports)]
11use num_derive::FromPrimitive;
12#[allow(unused_imports)]
13use num_derive::ToPrimitive;
14#[allow(unused_imports)]
15use num_traits::FromPrimitive;
16#[allow(unused_imports)]
17use num_traits::ToPrimitive;
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
21#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
22#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23#[cfg_attr(feature = "serde", serde(tag = "type"))]
24#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25#[repr(u32)]
26#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
27pub enum ActuatorConfiguration {
28 #[doc = "Do nothing."]
29 ACTUATOR_CONFIGURATION_NONE = 0,
30 #[doc = "Command the actuator to beep now."]
31 ACTUATOR_CONFIGURATION_BEEP = 1,
32 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
33 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
34 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
35 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
36 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
37 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
38 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
39 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
40}
41impl ActuatorConfiguration {
42 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
43}
44impl Default for ActuatorConfiguration {
45 fn default() -> Self {
46 Self::DEFAULT
47 }
48}
49#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
50#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
51#[cfg_attr(feature = "serde", serde(tag = "type"))]
52#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
53#[repr(u32)]
54#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
55pub enum ActuatorOutputFunction {
56 #[doc = "No function (disabled)."]
57 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
58 #[doc = "Motor 1"]
59 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
60 #[doc = "Motor 2"]
61 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
62 #[doc = "Motor 3"]
63 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
64 #[doc = "Motor 4"]
65 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
66 #[doc = "Motor 5"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
68 #[doc = "Motor 6"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
70 #[doc = "Motor 7"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
72 #[doc = "Motor 8"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
74 #[doc = "Motor 9"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
76 #[doc = "Motor 10"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
78 #[doc = "Motor 11"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
80 #[doc = "Motor 12"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
82 #[doc = "Motor 13"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
84 #[doc = "Motor 14"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
86 #[doc = "Motor 15"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
88 #[doc = "Motor 16"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
90 #[doc = "Servo 1"]
91 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
92 #[doc = "Servo 2"]
93 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
94 #[doc = "Servo 3"]
95 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
96 #[doc = "Servo 4"]
97 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
98 #[doc = "Servo 5"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
100 #[doc = "Servo 6"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
102 #[doc = "Servo 7"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
104 #[doc = "Servo 8"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
106 #[doc = "Servo 9"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
108 #[doc = "Servo 10"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
110 #[doc = "Servo 11"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
112 #[doc = "Servo 12"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
114 #[doc = "Servo 13"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
116 #[doc = "Servo 14"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
118 #[doc = "Servo 15"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
120 #[doc = "Servo 16"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
122}
123impl ActuatorOutputFunction {
124 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
125}
126impl Default for ActuatorOutputFunction {
127 fn default() -> Self {
128 Self::DEFAULT
129 }
130}
131#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
132#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
133#[cfg_attr(feature = "serde", serde(tag = "type"))]
134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
135#[repr(u32)]
136#[doc = "Enumeration of the ADSB altimeter types"]
137pub enum AdsbAltitudeType {
138 #[doc = "Altitude reported from a Baro source using QNH reference"]
139 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
140 #[doc = "Altitude reported from a GNSS source"]
141 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
142}
143impl AdsbAltitudeType {
144 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
145}
146impl Default for AdsbAltitudeType {
147 fn default() -> Self {
148 Self::DEFAULT
149 }
150}
151#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
153#[cfg_attr(feature = "serde", serde(tag = "type"))]
154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
155#[repr(u32)]
156#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
157pub enum AdsbEmitterType {
158 ADSB_EMITTER_TYPE_NO_INFO = 0,
159 ADSB_EMITTER_TYPE_LIGHT = 1,
160 ADSB_EMITTER_TYPE_SMALL = 2,
161 ADSB_EMITTER_TYPE_LARGE = 3,
162 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
163 ADSB_EMITTER_TYPE_HEAVY = 5,
164 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
165 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
166 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
167 ADSB_EMITTER_TYPE_GLIDER = 9,
168 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
169 ADSB_EMITTER_TYPE_PARACHUTE = 11,
170 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
171 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
172 ADSB_EMITTER_TYPE_UAV = 14,
173 ADSB_EMITTER_TYPE_SPACE = 15,
174 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
175 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
176 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
177 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
178}
179impl AdsbEmitterType {
180 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
181}
182impl Default for AdsbEmitterType {
183 fn default() -> Self {
184 Self::DEFAULT
185 }
186}
187bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
188impl AdsbFlags {
189 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
190}
191impl Default for AdsbFlags {
192 fn default() -> Self {
193 Self::DEFAULT
194 }
195}
196bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
197impl AisFlags {
198 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
199}
200impl Default for AisFlags {
201 fn default() -> Self {
202 Self::DEFAULT
203 }
204}
205#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
206#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
207#[cfg_attr(feature = "serde", serde(tag = "type"))]
208#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
209#[repr(u32)]
210#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
211pub enum AisNavStatus {
212 #[doc = "Under way using engine."]
213 UNDER_WAY = 0,
214 AIS_NAV_ANCHORED = 1,
215 AIS_NAV_UN_COMMANDED = 2,
216 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
217 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
218 AIS_NAV_MOORED = 5,
219 AIS_NAV_AGROUND = 6,
220 AIS_NAV_FISHING = 7,
221 AIS_NAV_SAILING = 8,
222 AIS_NAV_RESERVED_HSC = 9,
223 AIS_NAV_RESERVED_WIG = 10,
224 AIS_NAV_RESERVED_1 = 11,
225 AIS_NAV_RESERVED_2 = 12,
226 AIS_NAV_RESERVED_3 = 13,
227 #[doc = "Search And Rescue Transponder."]
228 AIS_NAV_AIS_SART = 14,
229 #[doc = "Not available (default)."]
230 AIS_NAV_UNKNOWN = 15,
231}
232impl AisNavStatus {
233 pub const DEFAULT: Self = Self::UNDER_WAY;
234}
235impl Default for AisNavStatus {
236 fn default() -> Self {
237 Self::DEFAULT
238 }
239}
240#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
242#[cfg_attr(feature = "serde", serde(tag = "type"))]
243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
244#[repr(u32)]
245#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
246pub enum AisType {
247 #[doc = "Not available (default)."]
248 AIS_TYPE_UNKNOWN = 0,
249 AIS_TYPE_RESERVED_1 = 1,
250 AIS_TYPE_RESERVED_2 = 2,
251 AIS_TYPE_RESERVED_3 = 3,
252 AIS_TYPE_RESERVED_4 = 4,
253 AIS_TYPE_RESERVED_5 = 5,
254 AIS_TYPE_RESERVED_6 = 6,
255 AIS_TYPE_RESERVED_7 = 7,
256 AIS_TYPE_RESERVED_8 = 8,
257 AIS_TYPE_RESERVED_9 = 9,
258 AIS_TYPE_RESERVED_10 = 10,
259 AIS_TYPE_RESERVED_11 = 11,
260 AIS_TYPE_RESERVED_12 = 12,
261 AIS_TYPE_RESERVED_13 = 13,
262 AIS_TYPE_RESERVED_14 = 14,
263 AIS_TYPE_RESERVED_15 = 15,
264 AIS_TYPE_RESERVED_16 = 16,
265 AIS_TYPE_RESERVED_17 = 17,
266 AIS_TYPE_RESERVED_18 = 18,
267 AIS_TYPE_RESERVED_19 = 19,
268 #[doc = "Wing In Ground effect."]
269 AIS_TYPE_WIG = 20,
270 AIS_TYPE_WIG_HAZARDOUS_A = 21,
271 AIS_TYPE_WIG_HAZARDOUS_B = 22,
272 AIS_TYPE_WIG_HAZARDOUS_C = 23,
273 AIS_TYPE_WIG_HAZARDOUS_D = 24,
274 AIS_TYPE_WIG_RESERVED_1 = 25,
275 AIS_TYPE_WIG_RESERVED_2 = 26,
276 AIS_TYPE_WIG_RESERVED_3 = 27,
277 AIS_TYPE_WIG_RESERVED_4 = 28,
278 AIS_TYPE_WIG_RESERVED_5 = 29,
279 AIS_TYPE_FISHING = 30,
280 AIS_TYPE_TOWING = 31,
281 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
282 AIS_TYPE_TOWING_LARGE = 32,
283 #[doc = "Dredging or other underwater ops."]
284 AIS_TYPE_DREDGING = 33,
285 AIS_TYPE_DIVING = 34,
286 AIS_TYPE_MILITARY = 35,
287 AIS_TYPE_SAILING = 36,
288 AIS_TYPE_PLEASURE = 37,
289 AIS_TYPE_RESERVED_20 = 38,
290 AIS_TYPE_RESERVED_21 = 39,
291 #[doc = "High Speed Craft."]
292 AIS_TYPE_HSC = 40,
293 AIS_TYPE_HSC_HAZARDOUS_A = 41,
294 AIS_TYPE_HSC_HAZARDOUS_B = 42,
295 AIS_TYPE_HSC_HAZARDOUS_C = 43,
296 AIS_TYPE_HSC_HAZARDOUS_D = 44,
297 AIS_TYPE_HSC_RESERVED_1 = 45,
298 AIS_TYPE_HSC_RESERVED_2 = 46,
299 AIS_TYPE_HSC_RESERVED_3 = 47,
300 AIS_TYPE_HSC_RESERVED_4 = 48,
301 AIS_TYPE_HSC_UNKNOWN = 49,
302 AIS_TYPE_PILOT = 50,
303 #[doc = "Search And Rescue vessel."]
304 AIS_TYPE_SAR = 51,
305 AIS_TYPE_TUG = 52,
306 AIS_TYPE_PORT_TENDER = 53,
307 #[doc = "Anti-pollution equipment."]
308 AIS_TYPE_ANTI_POLLUTION = 54,
309 AIS_TYPE_LAW_ENFORCEMENT = 55,
310 AIS_TYPE_SPARE_LOCAL_1 = 56,
311 AIS_TYPE_SPARE_LOCAL_2 = 57,
312 AIS_TYPE_MEDICAL_TRANSPORT = 58,
313 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
314 AIS_TYPE_NONECOMBATANT = 59,
315 AIS_TYPE_PASSENGER = 60,
316 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
317 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
318 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
319 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
320 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
321 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
322 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
323 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
324 AIS_TYPE_PASSENGER_UNKNOWN = 69,
325 AIS_TYPE_CARGO = 70,
326 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
327 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
328 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
329 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
330 AIS_TYPE_CARGO_RESERVED_1 = 75,
331 AIS_TYPE_CARGO_RESERVED_2 = 76,
332 AIS_TYPE_CARGO_RESERVED_3 = 77,
333 AIS_TYPE_CARGO_RESERVED_4 = 78,
334 AIS_TYPE_CARGO_UNKNOWN = 79,
335 AIS_TYPE_TANKER = 80,
336 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
337 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
338 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
339 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
340 AIS_TYPE_TANKER_RESERVED_1 = 85,
341 AIS_TYPE_TANKER_RESERVED_2 = 86,
342 AIS_TYPE_TANKER_RESERVED_3 = 87,
343 AIS_TYPE_TANKER_RESERVED_4 = 88,
344 AIS_TYPE_TANKER_UNKNOWN = 89,
345 AIS_TYPE_OTHER = 90,
346 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
347 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
348 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
349 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
350 AIS_TYPE_OTHER_RESERVED_1 = 95,
351 AIS_TYPE_OTHER_RESERVED_2 = 96,
352 AIS_TYPE_OTHER_RESERVED_3 = 97,
353 AIS_TYPE_OTHER_RESERVED_4 = 98,
354 AIS_TYPE_OTHER_UNKNOWN = 99,
355}
356impl AisType {
357 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
358}
359impl Default for AisType {
360 fn default() -> Self {
361 Self::DEFAULT
362 }
363}
364bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
365impl AttitudeTargetTypemask {
366 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
367}
368impl Default for AttitudeTargetTypemask {
369 fn default() -> Self {
370 Self::DEFAULT
371 }
372}
373#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
374#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
375#[cfg_attr(feature = "serde", serde(tag = "type"))]
376#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
377#[repr(u32)]
378#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
379pub enum AutotuneAxis {
380 #[doc = "Autotune roll axis."]
381 AUTOTUNE_AXIS_ROLL = 1,
382 #[doc = "Autotune pitch axis."]
383 AUTOTUNE_AXIS_PITCH = 2,
384 #[doc = "Autotune yaw axis."]
385 AUTOTUNE_AXIS_YAW = 4,
386}
387impl AutotuneAxis {
388 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
389}
390impl Default for AutotuneAxis {
391 fn default() -> Self {
392 Self::DEFAULT
393 }
394}
395bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
396impl CameraCapFlags {
397 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
398}
399impl Default for CameraCapFlags {
400 fn default() -> Self {
401 Self::DEFAULT
402 }
403}
404#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
406#[cfg_attr(feature = "serde", serde(tag = "type"))]
407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
408#[repr(u32)]
409#[doc = "Camera Modes."]
410pub enum CameraMode {
411 #[doc = "Camera is in image/photo capture mode."]
412 CAMERA_MODE_IMAGE = 0,
413 #[doc = "Camera is in video capture mode."]
414 CAMERA_MODE_VIDEO = 1,
415 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
416 CAMERA_MODE_IMAGE_SURVEY = 2,
417}
418impl CameraMode {
419 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
420}
421impl Default for CameraMode {
422 fn default() -> Self {
423 Self::DEFAULT
424 }
425}
426#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
427#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
428#[cfg_attr(feature = "serde", serde(tag = "type"))]
429#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
430#[repr(u32)]
431#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
432pub enum CameraSource {
433 #[doc = "Default camera source."]
434 CAMERA_SOURCE_DEFAULT = 0,
435 #[doc = "RGB camera source."]
436 CAMERA_SOURCE_RGB = 1,
437 #[doc = "IR camera source."]
438 CAMERA_SOURCE_IR = 2,
439 #[doc = "NDVI camera source."]
440 CAMERA_SOURCE_NDVI = 3,
441}
442impl CameraSource {
443 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
444}
445impl Default for CameraSource {
446 fn default() -> Self {
447 Self::DEFAULT
448 }
449}
450#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
451#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
452#[cfg_attr(feature = "serde", serde(tag = "type"))]
453#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
454#[repr(u32)]
455#[doc = "Camera tracking modes"]
456pub enum CameraTrackingMode {
457 #[doc = "Not tracking"]
458 CAMERA_TRACKING_MODE_NONE = 0,
459 #[doc = "Target is a point"]
460 CAMERA_TRACKING_MODE_POINT = 1,
461 #[doc = "Target is a rectangle"]
462 CAMERA_TRACKING_MODE_RECTANGLE = 2,
463}
464impl CameraTrackingMode {
465 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
466}
467impl Default for CameraTrackingMode {
468 fn default() -> Self {
469 Self::DEFAULT
470 }
471}
472#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
474#[cfg_attr(feature = "serde", serde(tag = "type"))]
475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
476#[repr(u32)]
477#[doc = "Camera tracking status flags"]
478pub enum CameraTrackingStatusFlags {
479 #[doc = "Camera is not tracking"]
480 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
481 #[doc = "Camera is tracking"]
482 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
483 #[doc = "Camera tracking in error state"]
484 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
485}
486impl CameraTrackingStatusFlags {
487 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
488}
489impl Default for CameraTrackingStatusFlags {
490 fn default() -> Self {
491 Self::DEFAULT
492 }
493}
494bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
495impl CameraTrackingTargetData {
496 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
497}
498impl Default for CameraTrackingTargetData {
499 fn default() -> Self {
500 Self::DEFAULT
501 }
502}
503#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
504#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
505#[cfg_attr(feature = "serde", serde(tag = "type"))]
506#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
507#[repr(u32)]
508#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
509pub enum CameraZoomType {
510 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
511 ZOOM_TYPE_STEP = 0,
512 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
513 ZOOM_TYPE_CONTINUOUS = 1,
514 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
515 ZOOM_TYPE_RANGE = 2,
516 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
517 ZOOM_TYPE_FOCAL_LENGTH = 3,
518 #[doc = "Zoom value as horizontal field of view in degrees."]
519 ZOOM_TYPE_HORIZONTAL_FOV = 4,
520}
521impl CameraZoomType {
522 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
523}
524impl Default for CameraZoomType {
525 fn default() -> Self {
526 Self::DEFAULT
527 }
528}
529#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
531#[cfg_attr(feature = "serde", serde(tag = "type"))]
532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
533#[repr(u32)]
534pub enum CanFilterOp {
535 CAN_FILTER_REPLACE = 0,
536 CAN_FILTER_ADD = 1,
537 CAN_FILTER_REMOVE = 2,
538}
539impl CanFilterOp {
540 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
541}
542impl Default for CanFilterOp {
543 fn default() -> Self {
544 Self::DEFAULT
545 }
546}
547#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
548#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
549#[cfg_attr(feature = "serde", serde(tag = "type"))]
550#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
551#[repr(u32)]
552#[doc = "Possible responses from a CELLULAR_CONFIG message."]
553pub enum CellularConfigResponse {
554 #[doc = "Changes accepted."]
555 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
556 #[doc = "Invalid APN."]
557 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
558 #[doc = "Invalid PIN."]
559 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
560 #[doc = "Changes rejected."]
561 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
562 #[doc = "PUK is required to unblock SIM card."]
563 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
564}
565impl CellularConfigResponse {
566 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
567}
568impl Default for CellularConfigResponse {
569 fn default() -> Self {
570 Self::DEFAULT
571 }
572}
573#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
574#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
575#[cfg_attr(feature = "serde", serde(tag = "type"))]
576#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
577#[repr(u32)]
578#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
579pub enum CellularNetworkFailedReason {
580 #[doc = "No error"]
581 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
582 #[doc = "Error state is unknown"]
583 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
584 #[doc = "SIM is required for the modem but missing"]
585 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
586 #[doc = "SIM is available, but not usable for connection"]
587 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
588}
589impl CellularNetworkFailedReason {
590 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
591}
592impl Default for CellularNetworkFailedReason {
593 fn default() -> Self {
594 Self::DEFAULT
595 }
596}
597#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
598#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
599#[cfg_attr(feature = "serde", serde(tag = "type"))]
600#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
601#[repr(u32)]
602#[doc = "Cellular network radio type"]
603pub enum CellularNetworkRadioType {
604 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
605 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
606 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
607 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
608 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
609}
610impl CellularNetworkRadioType {
611 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
612}
613impl Default for CellularNetworkRadioType {
614 fn default() -> Self {
615 Self::DEFAULT
616 }
617}
618#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
620#[cfg_attr(feature = "serde", serde(tag = "type"))]
621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
622#[repr(u32)]
623#[doc = "These flags encode the cellular network status"]
624pub enum CellularStatusFlag {
625 #[doc = "State unknown or not reportable."]
626 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
627 #[doc = "Modem is unusable"]
628 CELLULAR_STATUS_FLAG_FAILED = 1,
629 #[doc = "Modem is being initialized"]
630 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
631 #[doc = "Modem is locked"]
632 CELLULAR_STATUS_FLAG_LOCKED = 3,
633 #[doc = "Modem is not enabled and is powered down"]
634 CELLULAR_STATUS_FLAG_DISABLED = 4,
635 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
636 CELLULAR_STATUS_FLAG_DISABLING = 5,
637 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
638 CELLULAR_STATUS_FLAG_ENABLING = 6,
639 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
640 CELLULAR_STATUS_FLAG_ENABLED = 7,
641 #[doc = "Modem is searching for a network provider to register"]
642 CELLULAR_STATUS_FLAG_SEARCHING = 8,
643 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
644 CELLULAR_STATUS_FLAG_REGISTERED = 9,
645 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
646 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
647 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
648 CELLULAR_STATUS_FLAG_CONNECTING = 11,
649 #[doc = "One or more packet data bearers is active and connected"]
650 CELLULAR_STATUS_FLAG_CONNECTED = 12,
651}
652impl CellularStatusFlag {
653 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
654}
655impl Default for CellularStatusFlag {
656 fn default() -> Self {
657 Self::DEFAULT
658 }
659}
660#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
661#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
662#[cfg_attr(feature = "serde", serde(tag = "type"))]
663#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
664#[repr(u32)]
665#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
666pub enum CompMetadataType {
667 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
668 COMP_METADATA_TYPE_GENERAL = 0,
669 #[doc = "Parameter meta data."]
670 COMP_METADATA_TYPE_PARAMETER = 1,
671 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
672 COMP_METADATA_TYPE_COMMANDS = 2,
673 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
674 COMP_METADATA_TYPE_PERIPHERALS = 3,
675 #[doc = "Meta data for the events interface."]
676 COMP_METADATA_TYPE_EVENTS = 4,
677 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
678 COMP_METADATA_TYPE_ACTUATORS = 5,
679}
680impl CompMetadataType {
681 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
682}
683impl Default for CompMetadataType {
684 fn default() -> Self {
685 Self::DEFAULT
686 }
687}
688#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
689#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
690#[cfg_attr(feature = "serde", serde(tag = "type"))]
691#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
692#[repr(u32)]
693#[doc = "Indicates the ESC connection type."]
694pub enum EscConnectionType {
695 #[doc = "Traditional PPM ESC."]
696 ESC_CONNECTION_TYPE_PPM = 0,
697 #[doc = "Serial Bus connected ESC."]
698 ESC_CONNECTION_TYPE_SERIAL = 1,
699 #[doc = "One Shot PPM ESC."]
700 ESC_CONNECTION_TYPE_ONESHOT = 2,
701 #[doc = "I2C ESC."]
702 ESC_CONNECTION_TYPE_I2C = 3,
703 #[doc = "CAN-Bus ESC."]
704 ESC_CONNECTION_TYPE_CAN = 4,
705 #[doc = "DShot ESC."]
706 ESC_CONNECTION_TYPE_DSHOT = 5,
707}
708impl EscConnectionType {
709 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
710}
711impl Default for EscConnectionType {
712 fn default() -> Self {
713 Self::DEFAULT
714 }
715}
716bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
717impl EscFailureFlags {
718 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
719}
720impl Default for EscFailureFlags {
721 fn default() -> Self {
722 Self::DEFAULT
723 }
724}
725bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
726impl EstimatorStatusFlags {
727 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
728}
729impl Default for EstimatorStatusFlags {
730 fn default() -> Self {
731 Self::DEFAULT
732 }
733}
734#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
735#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
736#[cfg_attr(feature = "serde", serde(tag = "type"))]
737#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
738#[repr(u32)]
739#[doc = "List of possible failure type to inject."]
740pub enum FailureType {
741 #[doc = "No failure injected, used to reset a previous failure."]
742 FAILURE_TYPE_OK = 0,
743 #[doc = "Sets unit off, so completely non-responsive."]
744 FAILURE_TYPE_OFF = 1,
745 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
746 FAILURE_TYPE_STUCK = 2,
747 #[doc = "Unit is reporting complete garbage."]
748 FAILURE_TYPE_GARBAGE = 3,
749 #[doc = "Unit is consistently wrong."]
750 FAILURE_TYPE_WRONG = 4,
751 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
752 FAILURE_TYPE_SLOW = 5,
753 #[doc = "Data of unit is delayed in time."]
754 FAILURE_TYPE_DELAYED = 6,
755 #[doc = "Unit is sometimes working, sometimes not."]
756 FAILURE_TYPE_INTERMITTENT = 7,
757}
758impl FailureType {
759 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
760}
761impl Default for FailureType {
762 fn default() -> Self {
763 Self::DEFAULT
764 }
765}
766#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
767#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
768#[cfg_attr(feature = "serde", serde(tag = "type"))]
769#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
770#[repr(u32)]
771#[doc = "List of possible units where failures can be injected."]
772pub enum FailureUnit {
773 FAILURE_UNIT_SENSOR_GYRO = 0,
774 FAILURE_UNIT_SENSOR_ACCEL = 1,
775 FAILURE_UNIT_SENSOR_MAG = 2,
776 FAILURE_UNIT_SENSOR_BARO = 3,
777 FAILURE_UNIT_SENSOR_GPS = 4,
778 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
779 FAILURE_UNIT_SENSOR_VIO = 6,
780 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
781 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
782 FAILURE_UNIT_SYSTEM_BATTERY = 100,
783 FAILURE_UNIT_SYSTEM_MOTOR = 101,
784 FAILURE_UNIT_SYSTEM_SERVO = 102,
785 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
786 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
787 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
788}
789impl FailureUnit {
790 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
791}
792impl Default for FailureUnit {
793 fn default() -> Self {
794 Self::DEFAULT
795 }
796}
797#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
798#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
799#[cfg_attr(feature = "serde", serde(tag = "type"))]
800#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
801#[repr(u32)]
802pub enum FenceBreach {
803 #[doc = "No last fence breach"]
804 FENCE_BREACH_NONE = 0,
805 #[doc = "Breached minimum altitude"]
806 FENCE_BREACH_MINALT = 1,
807 #[doc = "Breached maximum altitude"]
808 FENCE_BREACH_MAXALT = 2,
809 #[doc = "Breached fence boundary"]
810 FENCE_BREACH_BOUNDARY = 3,
811}
812impl FenceBreach {
813 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
814}
815impl Default for FenceBreach {
816 fn default() -> Self {
817 Self::DEFAULT
818 }
819}
820#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
821#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
822#[cfg_attr(feature = "serde", serde(tag = "type"))]
823#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
824#[repr(u32)]
825#[doc = "Actions being taken to mitigate/prevent fence breach"]
826pub enum FenceMitigate {
827 #[doc = "Unknown"]
828 FENCE_MITIGATE_UNKNOWN = 0,
829 #[doc = "No actions being taken"]
830 FENCE_MITIGATE_NONE = 1,
831 #[doc = "Velocity limiting active to prevent breach"]
832 FENCE_MITIGATE_VEL_LIMIT = 2,
833}
834impl FenceMitigate {
835 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
836}
837impl Default for FenceMitigate {
838 fn default() -> Self {
839 Self::DEFAULT
840 }
841}
842#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
843#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
844#[cfg_attr(feature = "serde", serde(tag = "type"))]
845#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
846#[repr(u32)]
847#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
848pub enum FenceType {
849 #[doc = "Maximum altitude fence"]
850 FENCE_TYPE_ALT_MAX = 1,
851 #[doc = "Circle fence"]
852 FENCE_TYPE_CIRCLE = 2,
853 #[doc = "Polygon fence"]
854 FENCE_TYPE_POLYGON = 4,
855 #[doc = "Minimum altitude fence"]
856 FENCE_TYPE_ALT_MIN = 8,
857}
858impl FenceType {
859 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
860}
861impl Default for FenceType {
862 fn default() -> Self {
863 Self::DEFAULT
864 }
865}
866#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
868#[cfg_attr(feature = "serde", serde(tag = "type"))]
869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
870#[repr(u32)]
871#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
872pub enum FirmwareVersionType {
873 #[doc = "development release"]
874 FIRMWARE_VERSION_TYPE_DEV = 0,
875 #[doc = "alpha release"]
876 FIRMWARE_VERSION_TYPE_ALPHA = 64,
877 #[doc = "beta release"]
878 FIRMWARE_VERSION_TYPE_BETA = 128,
879 #[doc = "release candidate"]
880 FIRMWARE_VERSION_TYPE_RC = 192,
881 #[doc = "official stable release"]
882 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
883}
884impl FirmwareVersionType {
885 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
886}
887impl Default for FirmwareVersionType {
888 fn default() -> Self {
889 Self::DEFAULT
890 }
891}
892bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
893impl GimbalDeviceCapFlags {
894 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
895}
896impl Default for GimbalDeviceCapFlags {
897 fn default() -> Self {
898 Self::DEFAULT
899 }
900}
901bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
902impl GimbalDeviceErrorFlags {
903 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
904}
905impl Default for GimbalDeviceErrorFlags {
906 fn default() -> Self {
907 Self::DEFAULT
908 }
909}
910bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
911impl GimbalDeviceFlags {
912 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
913}
914impl Default for GimbalDeviceFlags {
915 fn default() -> Self {
916 Self::DEFAULT
917 }
918}
919bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
920impl GimbalManagerCapFlags {
921 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
922}
923impl Default for GimbalManagerCapFlags {
924 fn default() -> Self {
925 Self::DEFAULT
926 }
927}
928bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
929impl GimbalManagerFlags {
930 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
931}
932impl Default for GimbalManagerFlags {
933 fn default() -> Self {
934 Self::DEFAULT
935 }
936}
937#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
939#[cfg_attr(feature = "serde", serde(tag = "type"))]
940#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
941#[repr(u32)]
942#[doc = "Type of GPS fix"]
943pub enum GpsFixType {
944 #[doc = "No GPS connected"]
945 GPS_FIX_TYPE_NO_GPS = 0,
946 #[doc = "No position information, GPS is connected"]
947 GPS_FIX_TYPE_NO_FIX = 1,
948 #[doc = "2D position"]
949 GPS_FIX_TYPE_2D_FIX = 2,
950 #[doc = "3D position"]
951 GPS_FIX_TYPE_3D_FIX = 3,
952 #[doc = "DGPS/SBAS aided 3D position"]
953 GPS_FIX_TYPE_DGPS = 4,
954 #[doc = "RTK float, 3D position"]
955 GPS_FIX_TYPE_RTK_FLOAT = 5,
956 #[doc = "RTK Fixed, 3D position"]
957 GPS_FIX_TYPE_RTK_FIXED = 6,
958 #[doc = "Static fixed, typically used for base stations"]
959 GPS_FIX_TYPE_STATIC = 7,
960 #[doc = "PPP, 3D position."]
961 GPS_FIX_TYPE_PPP = 8,
962}
963impl GpsFixType {
964 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
965}
966impl Default for GpsFixType {
967 fn default() -> Self {
968 Self::DEFAULT
969 }
970}
971bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
972impl GpsInputIgnoreFlags {
973 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
974}
975impl Default for GpsInputIgnoreFlags {
976 fn default() -> Self {
977 Self::DEFAULT
978 }
979}
980#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
981#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
982#[cfg_attr(feature = "serde", serde(tag = "type"))]
983#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
984#[repr(u32)]
985#[doc = "Gripper actions."]
986pub enum GripperActions {
987 #[doc = "Gripper release cargo."]
988 GRIPPER_ACTION_RELEASE = 0,
989 #[doc = "Gripper grab onto cargo."]
990 GRIPPER_ACTION_GRAB = 1,
991}
992impl GripperActions {
993 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
994}
995impl Default for GripperActions {
996 fn default() -> Self {
997 Self::DEFAULT
998 }
999}
1000bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1001impl HighresImuUpdatedFlags {
1002 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1003}
1004impl Default for HighresImuUpdatedFlags {
1005 fn default() -> Self {
1006 Self::DEFAULT
1007 }
1008}
1009bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1010impl HilActuatorControlsFlags {
1011 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1012}
1013impl Default for HilActuatorControlsFlags {
1014 fn default() -> Self {
1015 Self::DEFAULT
1016 }
1017}
1018bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1019impl HilSensorUpdatedFlags {
1020 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1021}
1022impl Default for HilSensorUpdatedFlags {
1023 fn default() -> Self {
1024 Self::DEFAULT
1025 }
1026}
1027bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1028impl HlFailureFlag {
1029 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1030}
1031impl Default for HlFailureFlag {
1032 fn default() -> Self {
1033 Self::DEFAULT
1034 }
1035}
1036bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1037impl IlluminatorErrorFlags {
1038 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1039}
1040impl Default for IlluminatorErrorFlags {
1041 fn default() -> Self {
1042 Self::DEFAULT
1043 }
1044}
1045#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1046#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1047#[cfg_attr(feature = "serde", serde(tag = "type"))]
1048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1049#[repr(u32)]
1050#[doc = "Modes of illuminator"]
1051pub enum IlluminatorMode {
1052 #[doc = "Illuminator mode is not specified/unknown"]
1053 ILLUMINATOR_MODE_UNKNOWN = 0,
1054 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1055 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1056 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1057 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1058}
1059impl IlluminatorMode {
1060 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1061}
1062impl Default for IlluminatorMode {
1063 fn default() -> Self {
1064 Self::DEFAULT
1065 }
1066}
1067#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1068#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1069#[cfg_attr(feature = "serde", serde(tag = "type"))]
1070#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1071#[repr(u32)]
1072#[doc = "Type of landing target"]
1073pub enum LandingTargetType {
1074 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1075 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1076 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1077 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1078 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1079 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1080 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1081 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1082}
1083impl LandingTargetType {
1084 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1085}
1086impl Default for LandingTargetType {
1087 fn default() -> Self {
1088 Self::DEFAULT
1089 }
1090}
1091#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1092#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1093#[cfg_attr(feature = "serde", serde(tag = "type"))]
1094#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1095#[repr(u32)]
1096pub enum MagCalStatus {
1097 MAG_CAL_NOT_STARTED = 0,
1098 MAG_CAL_WAITING_TO_START = 1,
1099 MAG_CAL_RUNNING_STEP_ONE = 2,
1100 MAG_CAL_RUNNING_STEP_TWO = 3,
1101 MAG_CAL_SUCCESS = 4,
1102 MAG_CAL_FAILED = 5,
1103 MAG_CAL_BAD_ORIENTATION = 6,
1104 MAG_CAL_BAD_RADIUS = 7,
1105}
1106impl MagCalStatus {
1107 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1108}
1109impl Default for MagCalStatus {
1110 fn default() -> Self {
1111 Self::DEFAULT
1112 }
1113}
1114#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1116#[cfg_attr(feature = "serde", serde(tag = "type"))]
1117#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1118#[repr(u32)]
1119pub enum MavArmAuthDeniedReason {
1120 #[doc = "Not a specific reason"]
1121 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1122 #[doc = "Authorizer will send the error as string to GCS"]
1123 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1124 #[doc = "At least one waypoint have a invalid value"]
1125 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1126 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1127 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1128 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1129 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1130 #[doc = "Weather is not good to fly"]
1131 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1132}
1133impl MavArmAuthDeniedReason {
1134 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1135}
1136impl Default for MavArmAuthDeniedReason {
1137 fn default() -> Self {
1138 Self::DEFAULT
1139 }
1140}
1141#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1143#[cfg_attr(feature = "serde", serde(tag = "type"))]
1144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1145#[repr(u32)]
1146#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1147pub enum MavAutopilot {
1148 #[doc = "Generic autopilot, full support for everything"]
1149 MAV_AUTOPILOT_GENERIC = 0,
1150 #[doc = "Reserved for future use."]
1151 MAV_AUTOPILOT_RESERVED = 1,
1152 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1153 MAV_AUTOPILOT_SLUGS = 2,
1154 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1155 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1156 #[doc = "OpenPilot, <http://openpilot.org>"]
1157 MAV_AUTOPILOT_OPENPILOT = 4,
1158 #[doc = "Generic autopilot only supporting simple waypoints"]
1159 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1160 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1161 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1162 #[doc = "Generic autopilot supporting the full mission command set"]
1163 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1164 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1165 MAV_AUTOPILOT_INVALID = 8,
1166 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1167 MAV_AUTOPILOT_PPZ = 9,
1168 #[doc = "UAV Dev Board"]
1169 MAV_AUTOPILOT_UDB = 10,
1170 #[doc = "FlexiPilot"]
1171 MAV_AUTOPILOT_FP = 11,
1172 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1173 MAV_AUTOPILOT_PX4 = 12,
1174 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1175 MAV_AUTOPILOT_SMACCMPILOT = 13,
1176 #[doc = "AutoQuad -- <http://autoquad.org>"]
1177 MAV_AUTOPILOT_AUTOQUAD = 14,
1178 #[doc = "Armazila -- <http://armazila.com>"]
1179 MAV_AUTOPILOT_ARMAZILA = 15,
1180 #[doc = "Aerob -- <http://aerob.ru>"]
1181 MAV_AUTOPILOT_AEROB = 16,
1182 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1183 MAV_AUTOPILOT_ASLUAV = 17,
1184 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1185 MAV_AUTOPILOT_SMARTAP = 18,
1186 #[doc = "AirRails - <http://uaventure.com>"]
1187 MAV_AUTOPILOT_AIRRAILS = 19,
1188 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1189 MAV_AUTOPILOT_REFLEX = 20,
1190}
1191impl MavAutopilot {
1192 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1193}
1194impl Default for MavAutopilot {
1195 fn default() -> Self {
1196 Self::DEFAULT
1197 }
1198}
1199#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1200#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1201#[cfg_attr(feature = "serde", serde(tag = "type"))]
1202#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1203#[repr(u32)]
1204#[doc = "Enumeration for battery charge states."]
1205pub enum MavBatteryChargeState {
1206 #[doc = "Low battery state is not provided"]
1207 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1208 #[doc = "Battery is not in low state. Normal operation."]
1209 MAV_BATTERY_CHARGE_STATE_OK = 1,
1210 #[doc = "Battery state is low, warn and monitor close."]
1211 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1212 #[doc = "Battery state is critical, return or abort immediately."]
1213 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1214 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1215 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1216 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1217 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1218 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1219 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1220 #[doc = "Battery is charging."]
1221 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1222}
1223impl MavBatteryChargeState {
1224 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1225}
1226impl Default for MavBatteryChargeState {
1227 fn default() -> Self {
1228 Self::DEFAULT
1229 }
1230}
1231bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1232impl MavBatteryFault {
1233 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1234}
1235impl Default for MavBatteryFault {
1236 fn default() -> Self {
1237 Self::DEFAULT
1238 }
1239}
1240#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1242#[cfg_attr(feature = "serde", serde(tag = "type"))]
1243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1244#[repr(u32)]
1245#[doc = "Enumeration of battery functions"]
1246pub enum MavBatteryFunction {
1247 #[doc = "Battery function is unknown"]
1248 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1249 #[doc = "Battery supports all flight systems"]
1250 MAV_BATTERY_FUNCTION_ALL = 1,
1251 #[doc = "Battery for the propulsion system"]
1252 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1253 #[doc = "Avionics battery"]
1254 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1255 #[doc = "Payload battery"]
1256 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1257}
1258impl MavBatteryFunction {
1259 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1260}
1261impl Default for MavBatteryFunction {
1262 fn default() -> Self {
1263 Self::DEFAULT
1264 }
1265}
1266#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1267#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1268#[cfg_attr(feature = "serde", serde(tag = "type"))]
1269#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1270#[repr(u32)]
1271#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1272pub enum MavBatteryMode {
1273 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1274 MAV_BATTERY_MODE_UNKNOWN = 0,
1275 #[doc = "Battery is auto discharging (towards storage level)."]
1276 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1277 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1278 MAV_BATTERY_MODE_HOT_SWAP = 2,
1279}
1280impl MavBatteryMode {
1281 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1282}
1283impl Default for MavBatteryMode {
1284 fn default() -> Self {
1285 Self::DEFAULT
1286 }
1287}
1288#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1289#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1290#[cfg_attr(feature = "serde", serde(tag = "type"))]
1291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1292#[repr(u32)]
1293#[doc = "Enumeration of battery types"]
1294pub enum MavBatteryType {
1295 #[doc = "Not specified."]
1296 MAV_BATTERY_TYPE_UNKNOWN = 0,
1297 #[doc = "Lithium polymer battery"]
1298 MAV_BATTERY_TYPE_LIPO = 1,
1299 #[doc = "Lithium-iron-phosphate battery"]
1300 MAV_BATTERY_TYPE_LIFE = 2,
1301 #[doc = "Lithium-ION battery"]
1302 MAV_BATTERY_TYPE_LION = 3,
1303 #[doc = "Nickel metal hydride battery"]
1304 MAV_BATTERY_TYPE_NIMH = 4,
1305}
1306impl MavBatteryType {
1307 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1308}
1309impl Default for MavBatteryType {
1310 fn default() -> Self {
1311 Self::DEFAULT
1312 }
1313}
1314#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1315#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1316#[cfg_attr(feature = "serde", serde(tag = "type"))]
1317#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1318#[repr(u32)]
1319#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1320pub enum MavCmd {
1321 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1322 MAV_CMD_NAV_WAYPOINT = 16,
1323 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1324 MAV_CMD_NAV_LOITER_UNLIM = 17,
1325 #[doc = "Loiter around this waypoint for X turns"]
1326 MAV_CMD_NAV_LOITER_TURNS = 18,
1327 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1328 MAV_CMD_NAV_LOITER_TIME = 19,
1329 #[doc = "Return to launch location"]
1330 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1331 #[doc = "Land at location."]
1332 MAV_CMD_NAV_LAND = 21,
1333 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1334 MAV_CMD_NAV_TAKEOFF = 22,
1335 #[doc = "Land at local position (local frame only)"]
1336 MAV_CMD_NAV_LAND_LOCAL = 23,
1337 #[doc = "Takeoff from local position (local frame only)"]
1338 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1339 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1340 MAV_CMD_NAV_FOLLOW = 25,
1341 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1342 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1343 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1344 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1345 #[doc = "Begin following a target"]
1346 MAV_CMD_DO_FOLLOW = 32,
1347 #[doc = "Reposition the MAV after a follow target command has been sent"]
1348 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1349 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1350 MAV_CMD_DO_ORBIT = 34,
1351 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1352 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1353 MAV_CMD_NAV_ROI = 80,
1354 #[doc = "Control autonomous path planning on the MAV."]
1355 MAV_CMD_NAV_PATHPLANNING = 81,
1356 #[doc = "Navigate to waypoint using a spline path."]
1357 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1358 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1359 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1360 #[doc = "Land using VTOL mode"]
1361 MAV_CMD_NAV_VTOL_LAND = 85,
1362 #[doc = "hand control over to an external controller"]
1363 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1364 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1365 MAV_CMD_NAV_DELAY = 93,
1366 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1367 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1368 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1369 MAV_CMD_NAV_LAST = 95,
1370 #[doc = "Delay mission state machine."]
1371 MAV_CMD_CONDITION_DELAY = 112,
1372 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1373 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1374 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1375 MAV_CMD_CONDITION_DISTANCE = 114,
1376 #[doc = "Reach a certain target angle."]
1377 MAV_CMD_CONDITION_YAW = 115,
1378 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1379 MAV_CMD_CONDITION_LAST = 159,
1380 #[doc = "Set system mode."]
1381 MAV_CMD_DO_SET_MODE = 176,
1382 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1383 MAV_CMD_DO_JUMP = 177,
1384 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1385 MAV_CMD_DO_CHANGE_SPEED = 178,
1386 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1387 MAV_CMD_DO_SET_HOME = 179,
1388 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1389 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1390 MAV_CMD_DO_SET_PARAMETER = 180,
1391 #[doc = "Set a relay to a condition."]
1392 MAV_CMD_DO_SET_RELAY = 181,
1393 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1394 MAV_CMD_DO_REPEAT_RELAY = 182,
1395 #[doc = "Set a servo to a desired PWM value."]
1396 MAV_CMD_DO_SET_SERVO = 183,
1397 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1398 MAV_CMD_DO_REPEAT_SERVO = 184,
1399 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1400 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1401 #[doc = "Change altitude set point."]
1402 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1403 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1404 MAV_CMD_DO_SET_ACTUATOR = 187,
1405 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1406 MAV_CMD_DO_RETURN_PATH_START = 188,
1407 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1408 MAV_CMD_DO_LAND_START = 189,
1409 #[doc = "Mission command to perform a landing from a rally point."]
1410 MAV_CMD_DO_RALLY_LAND = 190,
1411 #[doc = "Mission command to safely abort an autonomous landing."]
1412 MAV_CMD_DO_GO_AROUND = 191,
1413 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1414 MAV_CMD_DO_REPOSITION = 192,
1415 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1416 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1417 #[doc = "Set moving direction to forward or reverse."]
1418 MAV_CMD_DO_SET_REVERSE = 194,
1419 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1420 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1421 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1422 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1423 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1424 MAV_CMD_DO_SET_ROI_NONE = 197,
1425 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1426 MAV_CMD_DO_SET_ROI_SYSID = 198,
1427 #[doc = "Control onboard camera system."]
1428 MAV_CMD_DO_CONTROL_VIDEO = 200,
1429 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1430 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1431 MAV_CMD_DO_SET_ROI = 201,
1432 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1433 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1434 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1435 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1436 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1437 #[doc = "Mission command to configure a camera or antenna mount"]
1438 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1439 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1440 #[doc = "Mission command to control a camera or antenna mount"]
1441 MAV_CMD_DO_MOUNT_CONTROL = 205,
1442 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1443 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1444 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1445 MAV_CMD_DO_FENCE_ENABLE = 207,
1446 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1447 MAV_CMD_DO_PARACHUTE = 208,
1448 #[doc = "Command to perform motor test."]
1449 MAV_CMD_DO_MOTOR_TEST = 209,
1450 #[doc = "Change to/from inverted flight."]
1451 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1452 #[doc = "Mission command to operate a gripper."]
1453 MAV_CMD_DO_GRIPPER = 211,
1454 #[doc = "Enable/disable autotune."]
1455 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1456 #[doc = "Sets a desired vehicle turn angle and speed change."]
1457 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1458 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1459 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1460 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1461 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1462 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1463 #[doc = "set id of master controller"]
1464 MAV_CMD_DO_GUIDED_MASTER = 221,
1465 #[doc = "Set limits for external control"]
1466 MAV_CMD_DO_GUIDED_LIMITS = 222,
1467 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1468 MAV_CMD_DO_ENGINE_CONTROL = 223,
1469 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1470 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1471 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1472 MAV_CMD_DO_LAST = 240,
1473 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1474 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1475 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1476 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1477 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1478 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1479 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1480 MAV_CMD_PREFLIGHT_STORAGE = 245,
1481 #[doc = "Request the reboot or shutdown of system components."]
1482 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1483 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1484 MAV_CMD_OVERRIDE_GOTO = 252,
1485 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1486 MAV_CMD_OBLIQUE_SURVEY = 260,
1487 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1488 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1489 #[doc = "start running a mission"]
1490 MAV_CMD_MISSION_START = 300,
1491 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1492 MAV_CMD_ACTUATOR_TEST = 310,
1493 #[doc = "Actuator configuration command."]
1494 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1495 #[doc = "Arms / Disarms a component"]
1496 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1497 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1498 MAV_CMD_RUN_PREARM_CHECKS = 401,
1499 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1500 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1501 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1502 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1503 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1504 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1505 MAV_CMD_GET_HOME_POSITION = 410,
1506 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1507 MAV_CMD_INJECT_FAILURE = 420,
1508 #[doc = "Starts receiver pairing."]
1509 MAV_CMD_START_RX_PAIR = 500,
1510 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1511 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1512 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1513 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1514 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1515 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1516 MAV_CMD_REQUEST_MESSAGE = 512,
1517 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1518 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1519 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1520 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1521 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1522 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1523 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1524 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1525 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1526 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1527 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1528 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1529 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1530 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1531 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1532 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1533 MAV_CMD_STORAGE_FORMAT = 526,
1534 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1535 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1536 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1537 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1538 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1539 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1540 #[doc = "Reset all camera settings to Factory Default"]
1541 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1542 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1543 MAV_CMD_SET_CAMERA_MODE = 530,
1544 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1545 MAV_CMD_SET_CAMERA_ZOOM = 531,
1546 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1547 MAV_CMD_SET_CAMERA_FOCUS = 532,
1548 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1549 MAV_CMD_SET_STORAGE_USAGE = 533,
1550 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1551 MAV_CMD_SET_CAMERA_SOURCE = 534,
1552 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1553 MAV_CMD_JUMP_TAG = 600,
1554 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1555 MAV_CMD_DO_JUMP_TAG = 601,
1556 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1557 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1558 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1559 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1560 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1561 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1562 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1563 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1564 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1565 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1566 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1567 #[doc = "Enable or disable on-board camera triggering system."]
1568 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1569 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1570 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1571 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1572 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1573 #[doc = "Stops ongoing tracking."]
1574 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1575 #[doc = "Starts video capture (recording)."]
1576 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1577 #[doc = "Stop the current video capture (recording)."]
1578 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1579 #[doc = "Start video streaming"]
1580 MAV_CMD_VIDEO_START_STREAMING = 2502,
1581 #[doc = "Stop the given video stream"]
1582 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1583 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1584 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1585 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1586 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1587 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1588 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1589 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1590 MAV_CMD_LOGGING_START = 2510,
1591 #[doc = "Request to stop streaming log data over MAVLink"]
1592 MAV_CMD_LOGGING_STOP = 2511,
1593 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1594 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1595 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1596 #[doc = "Create a panorama at the current position"]
1597 MAV_CMD_PANORAMA_CREATE = 2800,
1598 #[doc = "Request VTOL transition"]
1599 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1600 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1601 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1602 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1603 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1604 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1605 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1606 #[doc = "Delay mission state machine until gate has been reached."]
1607 MAV_CMD_CONDITION_GATE = 4501,
1608 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1609 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1610 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1611 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1612 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1613 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1614 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1615 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1616 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1617 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1618 #[doc = "Rally point. You can have multiple rally points defined."]
1619 MAV_CMD_NAV_RALLY_POINT = 5100,
1620 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1621 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1622 #[doc = "Change state of safety switch."]
1623 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1624 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1625 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1626 #[deprecated = " (Deprecated since 2021-06)"]
1627 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1628 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1629 #[deprecated = " (Deprecated since 2021-06)"]
1630 #[doc = "Control the payload deployment."]
1631 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1632 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1633 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1634 #[doc = "Command to operate winch."]
1635 MAV_CMD_DO_WINCH = 42600,
1636 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1637 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1638 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1639 MAV_CMD_WAYPOINT_USER_1 = 31000,
1640 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1641 MAV_CMD_WAYPOINT_USER_2 = 31001,
1642 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1643 MAV_CMD_WAYPOINT_USER_3 = 31002,
1644 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1645 MAV_CMD_WAYPOINT_USER_4 = 31003,
1646 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1647 MAV_CMD_WAYPOINT_USER_5 = 31004,
1648 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1649 MAV_CMD_SPATIAL_USER_1 = 31005,
1650 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1651 MAV_CMD_SPATIAL_USER_2 = 31006,
1652 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1653 MAV_CMD_SPATIAL_USER_3 = 31007,
1654 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1655 MAV_CMD_SPATIAL_USER_4 = 31008,
1656 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1657 MAV_CMD_SPATIAL_USER_5 = 31009,
1658 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1659 MAV_CMD_USER_1 = 31010,
1660 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1661 MAV_CMD_USER_2 = 31011,
1662 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1663 MAV_CMD_USER_3 = 31012,
1664 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1665 MAV_CMD_USER_4 = 31013,
1666 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1667 MAV_CMD_USER_5 = 31014,
1668 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1669 MAV_CMD_CAN_FORWARD = 32000,
1670}
1671impl MavCmd {
1672 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1673}
1674impl Default for MavCmd {
1675 fn default() -> Self {
1676 Self::DEFAULT
1677 }
1678}
1679#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1681#[cfg_attr(feature = "serde", serde(tag = "type"))]
1682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1683#[repr(u32)]
1684#[doc = "Possible actions an aircraft can take to avoid a collision."]
1685pub enum MavCollisionAction {
1686 #[doc = "Ignore any potential collisions"]
1687 MAV_COLLISION_ACTION_NONE = 0,
1688 #[doc = "Report potential collision"]
1689 MAV_COLLISION_ACTION_REPORT = 1,
1690 #[doc = "Ascend or Descend to avoid threat"]
1691 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1692 #[doc = "Move horizontally to avoid threat"]
1693 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1694 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1695 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1696 #[doc = "Aircraft to fly directly back to its launch point"]
1697 MAV_COLLISION_ACTION_RTL = 5,
1698 #[doc = "Aircraft to stop in place"]
1699 MAV_COLLISION_ACTION_HOVER = 6,
1700}
1701impl MavCollisionAction {
1702 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1703}
1704impl Default for MavCollisionAction {
1705 fn default() -> Self {
1706 Self::DEFAULT
1707 }
1708}
1709#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1710#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1711#[cfg_attr(feature = "serde", serde(tag = "type"))]
1712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1713#[repr(u32)]
1714#[doc = "Source of information about this collision."]
1715pub enum MavCollisionSrc {
1716 #[doc = "ID field references ADSB_VEHICLE packets"]
1717 MAV_COLLISION_SRC_ADSB = 0,
1718 #[doc = "ID field references MAVLink SRC ID"]
1719 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1720}
1721impl MavCollisionSrc {
1722 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1723}
1724impl Default for MavCollisionSrc {
1725 fn default() -> Self {
1726 Self::DEFAULT
1727 }
1728}
1729#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1730#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1731#[cfg_attr(feature = "serde", serde(tag = "type"))]
1732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1733#[repr(u32)]
1734#[doc = "Aircraft-rated danger from this threat."]
1735pub enum MavCollisionThreatLevel {
1736 #[doc = "Not a threat"]
1737 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1738 #[doc = "Craft is mildly concerned about this threat"]
1739 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1740 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1741 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1742}
1743impl MavCollisionThreatLevel {
1744 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1745}
1746impl Default for MavCollisionThreatLevel {
1747 fn default() -> Self {
1748 Self::DEFAULT
1749 }
1750}
1751#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1752#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1753#[cfg_attr(feature = "serde", serde(tag = "type"))]
1754#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1755#[repr(u32)]
1756#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1757pub enum MavComponent {
1758 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1759 MAV_COMP_ID_ALL = 0,
1760 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1761 MAV_COMP_ID_AUTOPILOT1 = 1,
1762 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1763 MAV_COMP_ID_USER1 = 25,
1764 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1765 MAV_COMP_ID_USER2 = 26,
1766 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1767 MAV_COMP_ID_USER3 = 27,
1768 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1769 MAV_COMP_ID_USER4 = 28,
1770 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1771 MAV_COMP_ID_USER5 = 29,
1772 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1773 MAV_COMP_ID_USER6 = 30,
1774 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1775 MAV_COMP_ID_USER7 = 31,
1776 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1777 MAV_COMP_ID_USER8 = 32,
1778 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1779 MAV_COMP_ID_USER9 = 33,
1780 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1781 MAV_COMP_ID_USER10 = 34,
1782 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1783 MAV_COMP_ID_USER11 = 35,
1784 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1785 MAV_COMP_ID_USER12 = 36,
1786 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1787 MAV_COMP_ID_USER13 = 37,
1788 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1789 MAV_COMP_ID_USER14 = 38,
1790 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1791 MAV_COMP_ID_USER15 = 39,
1792 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1793 MAV_COMP_ID_USER16 = 40,
1794 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1795 MAV_COMP_ID_USER17 = 41,
1796 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1797 MAV_COMP_ID_USER18 = 42,
1798 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1799 MAV_COMP_ID_USER19 = 43,
1800 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1801 MAV_COMP_ID_USER20 = 44,
1802 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1803 MAV_COMP_ID_USER21 = 45,
1804 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1805 MAV_COMP_ID_USER22 = 46,
1806 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1807 MAV_COMP_ID_USER23 = 47,
1808 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1809 MAV_COMP_ID_USER24 = 48,
1810 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1811 MAV_COMP_ID_USER25 = 49,
1812 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1813 MAV_COMP_ID_USER26 = 50,
1814 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1815 MAV_COMP_ID_USER27 = 51,
1816 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1817 MAV_COMP_ID_USER28 = 52,
1818 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1819 MAV_COMP_ID_USER29 = 53,
1820 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1821 MAV_COMP_ID_USER30 = 54,
1822 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1823 MAV_COMP_ID_USER31 = 55,
1824 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1825 MAV_COMP_ID_USER32 = 56,
1826 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1827 MAV_COMP_ID_USER33 = 57,
1828 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1829 MAV_COMP_ID_USER34 = 58,
1830 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1831 MAV_COMP_ID_USER35 = 59,
1832 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1833 MAV_COMP_ID_USER36 = 60,
1834 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1835 MAV_COMP_ID_USER37 = 61,
1836 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1837 MAV_COMP_ID_USER38 = 62,
1838 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1839 MAV_COMP_ID_USER39 = 63,
1840 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1841 MAV_COMP_ID_USER40 = 64,
1842 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1843 MAV_COMP_ID_USER41 = 65,
1844 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1845 MAV_COMP_ID_USER42 = 66,
1846 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1847 MAV_COMP_ID_USER43 = 67,
1848 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1849 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1851 MAV_COMP_ID_USER45 = 69,
1852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1853 MAV_COMP_ID_USER46 = 70,
1854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1855 MAV_COMP_ID_USER47 = 71,
1856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1857 MAV_COMP_ID_USER48 = 72,
1858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1859 MAV_COMP_ID_USER49 = 73,
1860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1861 MAV_COMP_ID_USER50 = 74,
1862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1863 MAV_COMP_ID_USER51 = 75,
1864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1865 MAV_COMP_ID_USER52 = 76,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER53 = 77,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER54 = 78,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER55 = 79,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER56 = 80,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER57 = 81,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER58 = 82,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER59 = 83,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER60 = 84,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER61 = 85,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER62 = 86,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER63 = 87,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER64 = 88,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER65 = 89,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER66 = 90,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER67 = 91,
1896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1897 MAV_COMP_ID_USER68 = 92,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER69 = 93,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER70 = 94,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER71 = 95,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER72 = 96,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER73 = 97,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER74 = 98,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER75 = 99,
1912 #[doc = "Camera #1."]
1913 MAV_COMP_ID_CAMERA = 100,
1914 #[doc = "Camera #2."]
1915 MAV_COMP_ID_CAMERA2 = 101,
1916 #[doc = "Camera #3."]
1917 MAV_COMP_ID_CAMERA3 = 102,
1918 #[doc = "Camera #4."]
1919 MAV_COMP_ID_CAMERA4 = 103,
1920 #[doc = "Camera #5."]
1921 MAV_COMP_ID_CAMERA5 = 104,
1922 #[doc = "Camera #6."]
1923 MAV_COMP_ID_CAMERA6 = 105,
1924 #[doc = "Servo #1."]
1925 MAV_COMP_ID_SERVO1 = 140,
1926 #[doc = "Servo #2."]
1927 MAV_COMP_ID_SERVO2 = 141,
1928 #[doc = "Servo #3."]
1929 MAV_COMP_ID_SERVO3 = 142,
1930 #[doc = "Servo #4."]
1931 MAV_COMP_ID_SERVO4 = 143,
1932 #[doc = "Servo #5."]
1933 MAV_COMP_ID_SERVO5 = 144,
1934 #[doc = "Servo #6."]
1935 MAV_COMP_ID_SERVO6 = 145,
1936 #[doc = "Servo #7."]
1937 MAV_COMP_ID_SERVO7 = 146,
1938 #[doc = "Servo #8."]
1939 MAV_COMP_ID_SERVO8 = 147,
1940 #[doc = "Servo #9."]
1941 MAV_COMP_ID_SERVO9 = 148,
1942 #[doc = "Servo #10."]
1943 MAV_COMP_ID_SERVO10 = 149,
1944 #[doc = "Servo #11."]
1945 MAV_COMP_ID_SERVO11 = 150,
1946 #[doc = "Servo #12."]
1947 MAV_COMP_ID_SERVO12 = 151,
1948 #[doc = "Servo #13."]
1949 MAV_COMP_ID_SERVO13 = 152,
1950 #[doc = "Servo #14."]
1951 MAV_COMP_ID_SERVO14 = 153,
1952 #[doc = "Gimbal #1."]
1953 MAV_COMP_ID_GIMBAL = 154,
1954 #[doc = "Logging component."]
1955 MAV_COMP_ID_LOG = 155,
1956 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
1957 MAV_COMP_ID_ADSB = 156,
1958 #[doc = "On Screen Display (OSD) devices for video links."]
1959 MAV_COMP_ID_OSD = 157,
1960 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
1961 MAV_COMP_ID_PERIPHERAL = 158,
1962 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
1963 #[doc = "Gimbal ID for QX1."]
1964 MAV_COMP_ID_QX1_GIMBAL = 159,
1965 #[doc = "FLARM collision alert component."]
1966 MAV_COMP_ID_FLARM = 160,
1967 #[doc = "Parachute component."]
1968 MAV_COMP_ID_PARACHUTE = 161,
1969 #[doc = "Winch component."]
1970 MAV_COMP_ID_WINCH = 169,
1971 #[doc = "Gimbal #2."]
1972 MAV_COMP_ID_GIMBAL2 = 171,
1973 #[doc = "Gimbal #3."]
1974 MAV_COMP_ID_GIMBAL3 = 172,
1975 #[doc = "Gimbal #4"]
1976 MAV_COMP_ID_GIMBAL4 = 173,
1977 #[doc = "Gimbal #5."]
1978 MAV_COMP_ID_GIMBAL5 = 174,
1979 #[doc = "Gimbal #6."]
1980 MAV_COMP_ID_GIMBAL6 = 175,
1981 #[doc = "Battery #1."]
1982 MAV_COMP_ID_BATTERY = 180,
1983 #[doc = "Battery #2."]
1984 MAV_COMP_ID_BATTERY2 = 181,
1985 #[doc = "CAN over MAVLink client."]
1986 MAV_COMP_ID_MAVCAN = 189,
1987 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
1988 MAV_COMP_ID_MISSIONPLANNER = 190,
1989 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1990 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
1991 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1992 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
1993 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1994 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
1995 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1996 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
1997 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
1998 MAV_COMP_ID_PATHPLANNER = 195,
1999 #[doc = "Component that plans a collision free path between two points."]
2000 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2001 #[doc = "Component that provides position estimates using VIO techniques."]
2002 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2003 #[doc = "Component that manages pairing of vehicle and GCS."]
2004 MAV_COMP_ID_PAIRING_MANAGER = 198,
2005 #[doc = "Inertial Measurement Unit (IMU) #1."]
2006 MAV_COMP_ID_IMU = 200,
2007 #[doc = "Inertial Measurement Unit (IMU) #2."]
2008 MAV_COMP_ID_IMU_2 = 201,
2009 #[doc = "Inertial Measurement Unit (IMU) #3."]
2010 MAV_COMP_ID_IMU_3 = 202,
2011 #[doc = "GPS #1."]
2012 MAV_COMP_ID_GPS = 220,
2013 #[doc = "GPS #2."]
2014 MAV_COMP_ID_GPS2 = 221,
2015 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2016 MAV_COMP_ID_ODID_TXRX_1 = 236,
2017 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2018 MAV_COMP_ID_ODID_TXRX_2 = 237,
2019 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2020 MAV_COMP_ID_ODID_TXRX_3 = 238,
2021 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2022 MAV_COMP_ID_UDP_BRIDGE = 240,
2023 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2024 MAV_COMP_ID_UART_BRIDGE = 241,
2025 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2026 MAV_COMP_ID_TUNNEL_NODE = 242,
2027 #[doc = "Illuminator"]
2028 MAV_COMP_ID_ILLUMINATOR = 243,
2029 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2030 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2031 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2032}
2033impl MavComponent {
2034 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2035}
2036impl Default for MavComponent {
2037 fn default() -> Self {
2038 Self::DEFAULT
2039 }
2040}
2041#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2043#[cfg_attr(feature = "serde", serde(tag = "type"))]
2044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2045#[repr(u32)]
2046#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2047#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2048pub enum MavDataStream {
2049 #[doc = "Enable all data streams"]
2050 MAV_DATA_STREAM_ALL = 0,
2051 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2052 MAV_DATA_STREAM_RAW_SENSORS = 1,
2053 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2054 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2055 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2056 MAV_DATA_STREAM_RC_CHANNELS = 3,
2057 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2058 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2059 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2060 MAV_DATA_STREAM_POSITION = 6,
2061 #[doc = "Dependent on the autopilot"]
2062 MAV_DATA_STREAM_EXTRA1 = 10,
2063 #[doc = "Dependent on the autopilot"]
2064 MAV_DATA_STREAM_EXTRA2 = 11,
2065 #[doc = "Dependent on the autopilot"]
2066 MAV_DATA_STREAM_EXTRA3 = 12,
2067}
2068impl MavDataStream {
2069 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2070}
2071impl Default for MavDataStream {
2072 fn default() -> Self {
2073 Self::DEFAULT
2074 }
2075}
2076#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2077#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2078#[cfg_attr(feature = "serde", serde(tag = "type"))]
2079#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2080#[repr(u32)]
2081#[doc = "Enumeration of distance sensor types"]
2082pub enum MavDistanceSensor {
2083 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2084 MAV_DISTANCE_SENSOR_LASER = 0,
2085 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2086 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2087 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2088 MAV_DISTANCE_SENSOR_INFRARED = 2,
2089 #[doc = "Radar type, e.g. uLanding units"]
2090 MAV_DISTANCE_SENSOR_RADAR = 3,
2091 #[doc = "Broken or unknown type, e.g. analog units"]
2092 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2093}
2094impl MavDistanceSensor {
2095 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2096}
2097impl Default for MavDistanceSensor {
2098 fn default() -> Self {
2099 Self::DEFAULT
2100 }
2101}
2102#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2103#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2104#[cfg_attr(feature = "serde", serde(tag = "type"))]
2105#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2106#[repr(u32)]
2107#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2108pub enum MavDoRepositionFlags {
2109 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2110 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2111}
2112impl MavDoRepositionFlags {
2113 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2114}
2115impl Default for MavDoRepositionFlags {
2116 fn default() -> Self {
2117 Self::DEFAULT
2118 }
2119}
2120#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2121#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2122#[cfg_attr(feature = "serde", serde(tag = "type"))]
2123#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2124#[repr(u32)]
2125#[doc = "Enumeration of estimator types"]
2126pub enum MavEstimatorType {
2127 #[doc = "Unknown type of the estimator."]
2128 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2129 #[doc = "This is a naive estimator without any real covariance feedback."]
2130 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2131 #[doc = "Computer vision based estimate. Might be up to scale."]
2132 MAV_ESTIMATOR_TYPE_VISION = 2,
2133 #[doc = "Visual-inertial estimate."]
2134 MAV_ESTIMATOR_TYPE_VIO = 3,
2135 #[doc = "Plain GPS estimate."]
2136 MAV_ESTIMATOR_TYPE_GPS = 4,
2137 #[doc = "Estimator integrating GPS and inertial sensing."]
2138 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2139 #[doc = "Estimate from external motion capturing system."]
2140 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2141 #[doc = "Estimator based on lidar sensor input."]
2142 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2143 #[doc = "Estimator on autopilot."]
2144 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2145}
2146impl MavEstimatorType {
2147 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2148}
2149impl Default for MavEstimatorType {
2150 fn default() -> Self {
2151 Self::DEFAULT
2152 }
2153}
2154#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2156#[cfg_attr(feature = "serde", serde(tag = "type"))]
2157#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2158#[repr(u32)]
2159#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2160pub enum MavEventCurrentSequenceFlags {
2161 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2162 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2163}
2164impl MavEventCurrentSequenceFlags {
2165 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2166}
2167impl Default for MavEventCurrentSequenceFlags {
2168 fn default() -> Self {
2169 Self::DEFAULT
2170 }
2171}
2172#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2173#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2174#[cfg_attr(feature = "serde", serde(tag = "type"))]
2175#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2176#[repr(u32)]
2177#[doc = "Reason for an event error response."]
2178pub enum MavEventErrorReason {
2179 #[doc = "The requested event is not available (anymore)."]
2180 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2181}
2182impl MavEventErrorReason {
2183 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2184}
2185impl Default for MavEventErrorReason {
2186 fn default() -> Self {
2187 Self::DEFAULT
2188 }
2189}
2190#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2191#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2192#[cfg_attr(feature = "serde", serde(tag = "type"))]
2193#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2194#[repr(u32)]
2195#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2196pub enum MavFrame {
2197 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2198 MAV_FRAME_GLOBAL = 0,
2199 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2200 MAV_FRAME_LOCAL_NED = 1,
2201 #[doc = "NOT a coordinate frame, indicates a mission command."]
2202 MAV_FRAME_MISSION = 2,
2203 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2204 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2205 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2206 MAV_FRAME_LOCAL_ENU = 4,
2207 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2208 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2209 MAV_FRAME_GLOBAL_INT = 5,
2210 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2211 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2212 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2213 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2214 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2215 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2216 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2217 MAV_FRAME_BODY_NED = 8,
2218 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2219 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2220 MAV_FRAME_BODY_OFFSET_NED = 9,
2221 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2222 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2223 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2224 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2225 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2226 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2227 MAV_FRAME_BODY_FRD = 12,
2228 #[deprecated = " (Deprecated since 2019-04)"]
2229 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2230 MAV_FRAME_RESERVED_13 = 13,
2231 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2232 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2233 MAV_FRAME_RESERVED_14 = 14,
2234 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2235 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2236 MAV_FRAME_RESERVED_15 = 15,
2237 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2238 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2239 MAV_FRAME_RESERVED_16 = 16,
2240 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2241 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2242 MAV_FRAME_RESERVED_17 = 17,
2243 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2244 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2245 MAV_FRAME_RESERVED_18 = 18,
2246 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2247 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2248 MAV_FRAME_RESERVED_19 = 19,
2249 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2250 MAV_FRAME_LOCAL_FRD = 20,
2251 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2252 MAV_FRAME_LOCAL_FLU = 21,
2253}
2254impl MavFrame {
2255 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2256}
2257impl Default for MavFrame {
2258 fn default() -> Self {
2259 Self::DEFAULT
2260 }
2261}
2262#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2263#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2264#[cfg_attr(feature = "serde", serde(tag = "type"))]
2265#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2266#[repr(u32)]
2267#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2268pub enum MavFtpErr {
2269 #[doc = "None: No error"]
2270 MAV_FTP_ERR_NONE = 0,
2271 #[doc = "Fail: Unknown failure"]
2272 MAV_FTP_ERR_FAIL = 1,
2273 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2274 MAV_FTP_ERR_FAILERRNO = 2,
2275 #[doc = "InvalidDataSize: Payload size is invalid"]
2276 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2277 #[doc = "InvalidSession: Session is not currently open"]
2278 MAV_FTP_ERR_INVALIDSESSION = 4,
2279 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2280 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2281 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2282 MAV_FTP_ERR_EOF = 6,
2283 #[doc = "UnknownCommand: Unknown command / opcode"]
2284 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2285 #[doc = "FileExists: File/directory already exists"]
2286 MAV_FTP_ERR_FILEEXISTS = 8,
2287 #[doc = "FileProtected: File/directory is write protected"]
2288 MAV_FTP_ERR_FILEPROTECTED = 9,
2289 #[doc = "FileNotFound: File/directory not found"]
2290 MAV_FTP_ERR_FILENOTFOUND = 10,
2291}
2292impl MavFtpErr {
2293 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2294}
2295impl Default for MavFtpErr {
2296 fn default() -> Self {
2297 Self::DEFAULT
2298 }
2299}
2300#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2301#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2302#[cfg_attr(feature = "serde", serde(tag = "type"))]
2303#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2304#[repr(u32)]
2305#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2306pub enum MavFtpOpcode {
2307 #[doc = "None. Ignored, always ACKed"]
2308 MAV_FTP_OPCODE_NONE = 0,
2309 #[doc = "TerminateSession: Terminates open Read session"]
2310 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2311 #[doc = "ResetSessions: Terminates all open read sessions"]
2312 MAV_FTP_OPCODE_RESETSESSION = 2,
2313 #[doc = "ListDirectory. List files and directories in path from offset"]
2314 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2315 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2316 MAV_FTP_OPCODE_OPENFILERO = 4,
2317 #[doc = "ReadFile: Reads size bytes from offset in session"]
2318 MAV_FTP_OPCODE_READFILE = 5,
2319 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2320 MAV_FTP_OPCODE_CREATEFILE = 6,
2321 #[doc = "WriteFile: Writes size bytes to offset in session"]
2322 MAV_FTP_OPCODE_WRITEFILE = 7,
2323 #[doc = "RemoveFile: Remove file at path"]
2324 MAV_FTP_OPCODE_REMOVEFILE = 8,
2325 #[doc = "CreateDirectory: Creates directory at path"]
2326 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2327 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2328 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2329 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2330 MAV_FTP_OPCODE_OPENFILEWO = 11,
2331 #[doc = "TruncateFile: Truncate file at path to offset length"]
2332 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2333 #[doc = "Rename: Rename path1 to path2"]
2334 MAV_FTP_OPCODE_RENAME = 13,
2335 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2336 MAV_FTP_OPCODE_CALCFILECRC = 14,
2337 #[doc = "BurstReadFile: Burst download session file"]
2338 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2339 #[doc = "ACK: ACK response"]
2340 MAV_FTP_OPCODE_ACK = 128,
2341 #[doc = "NAK: NAK response"]
2342 MAV_FTP_OPCODE_NAK = 129,
2343}
2344impl MavFtpOpcode {
2345 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2346}
2347impl Default for MavFtpOpcode {
2348 fn default() -> Self {
2349 Self::DEFAULT
2350 }
2351}
2352#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2353#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2354#[cfg_attr(feature = "serde", serde(tag = "type"))]
2355#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2356#[repr(u32)]
2357#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2358pub enum MavFuelType {
2359 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2360 MAV_FUEL_TYPE_UNKNOWN = 0,
2361 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2362 MAV_FUEL_TYPE_LIQUID = 1,
2363 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2364 MAV_FUEL_TYPE_GAS = 2,
2365}
2366impl MavFuelType {
2367 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2368}
2369impl Default for MavFuelType {
2370 fn default() -> Self {
2371 Self::DEFAULT
2372 }
2373}
2374bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2375impl MavGeneratorStatusFlag {
2376 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2377}
2378impl Default for MavGeneratorStatusFlag {
2379 fn default() -> Self {
2380 Self::DEFAULT
2381 }
2382}
2383#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2384#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2385#[cfg_attr(feature = "serde", serde(tag = "type"))]
2386#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2387#[repr(u32)]
2388#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2389pub enum MavGoto {
2390 #[doc = "Hold at the current position."]
2391 MAV_GOTO_DO_HOLD = 0,
2392 #[doc = "Continue with the next item in mission execution."]
2393 MAV_GOTO_DO_CONTINUE = 1,
2394 #[doc = "Hold at the current position of the system"]
2395 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2396 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2397 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2398}
2399impl MavGoto {
2400 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2401}
2402impl Default for MavGoto {
2403 fn default() -> Self {
2404 Self::DEFAULT
2405 }
2406}
2407#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2408#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2409#[cfg_attr(feature = "serde", serde(tag = "type"))]
2410#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2411#[repr(u32)]
2412#[doc = "Enumeration of landed detector states"]
2413pub enum MavLandedState {
2414 #[doc = "MAV landed state is unknown"]
2415 MAV_LANDED_STATE_UNDEFINED = 0,
2416 #[doc = "MAV is landed (on ground)"]
2417 MAV_LANDED_STATE_ON_GROUND = 1,
2418 #[doc = "MAV is in air"]
2419 MAV_LANDED_STATE_IN_AIR = 2,
2420 #[doc = "MAV currently taking off"]
2421 MAV_LANDED_STATE_TAKEOFF = 3,
2422 #[doc = "MAV currently landing"]
2423 MAV_LANDED_STATE_LANDING = 4,
2424}
2425impl MavLandedState {
2426 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2427}
2428impl Default for MavLandedState {
2429 fn default() -> Self {
2430 Self::DEFAULT
2431 }
2432}
2433#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2434#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2435#[cfg_attr(feature = "serde", serde(tag = "type"))]
2436#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2437#[repr(u32)]
2438#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2439pub enum MavMissionResult {
2440 #[doc = "mission accepted OK"]
2441 MAV_MISSION_ACCEPTED = 0,
2442 #[doc = "Generic error / not accepting mission commands at all right now."]
2443 MAV_MISSION_ERROR = 1,
2444 #[doc = "Coordinate frame is not supported."]
2445 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2446 #[doc = "Command is not supported."]
2447 MAV_MISSION_UNSUPPORTED = 3,
2448 #[doc = "Mission items exceed storage space."]
2449 MAV_MISSION_NO_SPACE = 4,
2450 #[doc = "One of the parameters has an invalid value."]
2451 MAV_MISSION_INVALID = 5,
2452 #[doc = "param1 has an invalid value."]
2453 MAV_MISSION_INVALID_PARAM1 = 6,
2454 #[doc = "param2 has an invalid value."]
2455 MAV_MISSION_INVALID_PARAM2 = 7,
2456 #[doc = "param3 has an invalid value."]
2457 MAV_MISSION_INVALID_PARAM3 = 8,
2458 #[doc = "param4 has an invalid value."]
2459 MAV_MISSION_INVALID_PARAM4 = 9,
2460 #[doc = "x / param5 has an invalid value."]
2461 MAV_MISSION_INVALID_PARAM5_X = 10,
2462 #[doc = "y / param6 has an invalid value."]
2463 MAV_MISSION_INVALID_PARAM6_Y = 11,
2464 #[doc = "z / param7 has an invalid value."]
2465 MAV_MISSION_INVALID_PARAM7 = 12,
2466 #[doc = "Mission item received out of sequence"]
2467 MAV_MISSION_INVALID_SEQUENCE = 13,
2468 #[doc = "Not accepting any mission commands from this communication partner."]
2469 MAV_MISSION_DENIED = 14,
2470 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2471 MAV_MISSION_OPERATION_CANCELLED = 15,
2472}
2473impl MavMissionResult {
2474 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2475}
2476impl Default for MavMissionResult {
2477 fn default() -> Self {
2478 Self::DEFAULT
2479 }
2480}
2481#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2482#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2483#[cfg_attr(feature = "serde", serde(tag = "type"))]
2484#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2485#[repr(u32)]
2486#[doc = "Type of mission items being requested/sent in mission protocol."]
2487pub enum MavMissionType {
2488 #[doc = "Items are mission commands for main mission."]
2489 MAV_MISSION_TYPE_MISSION = 0,
2490 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2491 MAV_MISSION_TYPE_FENCE = 1,
2492 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2493 MAV_MISSION_TYPE_RALLY = 2,
2494 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2495 MAV_MISSION_TYPE_ALL = 255,
2496}
2497impl MavMissionType {
2498 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2499}
2500impl Default for MavMissionType {
2501 fn default() -> Self {
2502 Self::DEFAULT
2503 }
2504}
2505#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2506#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2507#[cfg_attr(feature = "serde", serde(tag = "type"))]
2508#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2509#[repr(u32)]
2510#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2511pub enum MavMode {
2512 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2513 MAV_MODE_PREFLIGHT = 0,
2514 #[doc = "System is allowed to be active, under assisted RC control."]
2515 MAV_MODE_STABILIZE_DISARMED = 80,
2516 #[doc = "System is allowed to be active, under assisted RC control."]
2517 MAV_MODE_STABILIZE_ARMED = 208,
2518 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2519 MAV_MODE_MANUAL_DISARMED = 64,
2520 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2521 MAV_MODE_MANUAL_ARMED = 192,
2522 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2523 MAV_MODE_GUIDED_DISARMED = 88,
2524 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2525 MAV_MODE_GUIDED_ARMED = 216,
2526 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2527 MAV_MODE_AUTO_DISARMED = 92,
2528 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2529 MAV_MODE_AUTO_ARMED = 220,
2530 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2531 MAV_MODE_TEST_DISARMED = 66,
2532 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2533 MAV_MODE_TEST_ARMED = 194,
2534}
2535impl MavMode {
2536 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2537}
2538impl Default for MavMode {
2539 fn default() -> Self {
2540 Self::DEFAULT
2541 }
2542}
2543bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2544impl MavModeFlag {
2545 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2546}
2547impl Default for MavModeFlag {
2548 fn default() -> Self {
2549 Self::DEFAULT
2550 }
2551}
2552#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2553#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2554#[cfg_attr(feature = "serde", serde(tag = "type"))]
2555#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2556#[repr(u32)]
2557#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2558pub enum MavModeFlagDecodePosition {
2559 #[doc = "First bit: 10000000"]
2560 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2561 #[doc = "Second bit: 01000000"]
2562 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2563 #[doc = "Third bit: 00100000"]
2564 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2565 #[doc = "Fourth bit: 00010000"]
2566 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2567 #[doc = "Fifth bit: 00001000"]
2568 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2569 #[doc = "Sixth bit: 00000100"]
2570 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2571 #[doc = "Seventh bit: 00000010"]
2572 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2573 #[doc = "Eighth bit: 00000001"]
2574 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2575}
2576impl MavModeFlagDecodePosition {
2577 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2578}
2579impl Default for MavModeFlagDecodePosition {
2580 fn default() -> Self {
2581 Self::DEFAULT
2582 }
2583}
2584bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2585impl MavModeProperty {
2586 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2587}
2588impl Default for MavModeProperty {
2589 fn default() -> Self {
2590 Self::DEFAULT
2591 }
2592}
2593#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2594#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2595#[cfg_attr(feature = "serde", serde(tag = "type"))]
2596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2597#[repr(u32)]
2598#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2599#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2600pub enum MavMountMode {
2601 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2602 MAV_MOUNT_MODE_RETRACT = 0,
2603 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2604 MAV_MOUNT_MODE_NEUTRAL = 1,
2605 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2606 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2607 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2608 MAV_MOUNT_MODE_RC_TARGETING = 3,
2609 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2610 MAV_MOUNT_MODE_GPS_POINT = 4,
2611 #[doc = "Gimbal tracks system with specified system ID"]
2612 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2613 #[doc = "Gimbal tracks home position"]
2614 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2615}
2616impl MavMountMode {
2617 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2618}
2619impl Default for MavMountMode {
2620 fn default() -> Self {
2621 Self::DEFAULT
2622 }
2623}
2624#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2625#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2626#[cfg_attr(feature = "serde", serde(tag = "type"))]
2627#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2628#[repr(u32)]
2629pub enum MavOdidArmStatus {
2630 #[doc = "Passing arming checks."]
2631 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2632 #[doc = "Generic arming failure, see error string for details."]
2633 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2634}
2635impl MavOdidArmStatus {
2636 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2637}
2638impl Default for MavOdidArmStatus {
2639 fn default() -> Self {
2640 Self::DEFAULT
2641 }
2642}
2643#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2644#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2645#[cfg_attr(feature = "serde", serde(tag = "type"))]
2646#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2647#[repr(u32)]
2648pub enum MavOdidAuthType {
2649 #[doc = "No authentication type is specified."]
2650 MAV_ODID_AUTH_TYPE_NONE = 0,
2651 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2652 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2653 #[doc = "Signature for the Operator ID."]
2654 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2655 #[doc = "Signature for the entire message set."]
2656 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2657 #[doc = "Authentication is provided by Network Remote ID."]
2658 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2659 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2660 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2661}
2662impl MavOdidAuthType {
2663 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2664}
2665impl Default for MavOdidAuthType {
2666 fn default() -> Self {
2667 Self::DEFAULT
2668 }
2669}
2670#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2672#[cfg_attr(feature = "serde", serde(tag = "type"))]
2673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2674#[repr(u32)]
2675pub enum MavOdidCategoryEu {
2676 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2677 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2678 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2679 MAV_ODID_CATEGORY_EU_OPEN = 1,
2680 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2681 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2682 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2683 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2684}
2685impl MavOdidCategoryEu {
2686 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2687}
2688impl Default for MavOdidCategoryEu {
2689 fn default() -> Self {
2690 Self::DEFAULT
2691 }
2692}
2693#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2694#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2695#[cfg_attr(feature = "serde", serde(tag = "type"))]
2696#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2697#[repr(u32)]
2698pub enum MavOdidClassEu {
2699 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2700 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2701 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2702 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2703 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2704 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2705 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2706 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2707 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2708 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2709 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2710 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2711 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2712 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2713 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2714 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2715}
2716impl MavOdidClassEu {
2717 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2718}
2719impl Default for MavOdidClassEu {
2720 fn default() -> Self {
2721 Self::DEFAULT
2722 }
2723}
2724#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2725#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2726#[cfg_attr(feature = "serde", serde(tag = "type"))]
2727#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2728#[repr(u32)]
2729pub enum MavOdidClassificationType {
2730 #[doc = "The classification type for the UA is undeclared."]
2731 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2732 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2733 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2734}
2735impl MavOdidClassificationType {
2736 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2737}
2738impl Default for MavOdidClassificationType {
2739 fn default() -> Self {
2740 Self::DEFAULT
2741 }
2742}
2743#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2744#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2745#[cfg_attr(feature = "serde", serde(tag = "type"))]
2746#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2747#[repr(u32)]
2748pub enum MavOdidDescType {
2749 #[doc = "Optional free-form text description of the purpose of the flight."]
2750 MAV_ODID_DESC_TYPE_TEXT = 0,
2751 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2752 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2753 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2754 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2755}
2756impl MavOdidDescType {
2757 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2758}
2759impl Default for MavOdidDescType {
2760 fn default() -> Self {
2761 Self::DEFAULT
2762 }
2763}
2764#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2765#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2766#[cfg_attr(feature = "serde", serde(tag = "type"))]
2767#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2768#[repr(u32)]
2769pub enum MavOdidHeightRef {
2770 #[doc = "The height field is relative to the take-off location."]
2771 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2772 #[doc = "The height field is relative to ground."]
2773 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2774}
2775impl MavOdidHeightRef {
2776 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2777}
2778impl Default for MavOdidHeightRef {
2779 fn default() -> Self {
2780 Self::DEFAULT
2781 }
2782}
2783#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2784#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2785#[cfg_attr(feature = "serde", serde(tag = "type"))]
2786#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2787#[repr(u32)]
2788pub enum MavOdidHorAcc {
2789 #[doc = "The horizontal accuracy is unknown."]
2790 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2791 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2792 MAV_ODID_HOR_ACC_10NM = 1,
2793 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2794 MAV_ODID_HOR_ACC_4NM = 2,
2795 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2796 MAV_ODID_HOR_ACC_2NM = 3,
2797 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2798 MAV_ODID_HOR_ACC_1NM = 4,
2799 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2800 MAV_ODID_HOR_ACC_0_5NM = 5,
2801 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2802 MAV_ODID_HOR_ACC_0_3NM = 6,
2803 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2804 MAV_ODID_HOR_ACC_0_1NM = 7,
2805 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2806 MAV_ODID_HOR_ACC_0_05NM = 8,
2807 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2808 MAV_ODID_HOR_ACC_30_METER = 9,
2809 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2810 MAV_ODID_HOR_ACC_10_METER = 10,
2811 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2812 MAV_ODID_HOR_ACC_3_METER = 11,
2813 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2814 MAV_ODID_HOR_ACC_1_METER = 12,
2815}
2816impl MavOdidHorAcc {
2817 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2818}
2819impl Default for MavOdidHorAcc {
2820 fn default() -> Self {
2821 Self::DEFAULT
2822 }
2823}
2824#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2825#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2826#[cfg_attr(feature = "serde", serde(tag = "type"))]
2827#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2828#[repr(u32)]
2829pub enum MavOdidIdType {
2830 #[doc = "No type defined."]
2831 MAV_ODID_ID_TYPE_NONE = 0,
2832 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2833 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2834 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2835 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2836 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2837 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2838 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2839 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2840}
2841impl MavOdidIdType {
2842 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2843}
2844impl Default for MavOdidIdType {
2845 fn default() -> Self {
2846 Self::DEFAULT
2847 }
2848}
2849#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2850#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2851#[cfg_attr(feature = "serde", serde(tag = "type"))]
2852#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2853#[repr(u32)]
2854pub enum MavOdidOperatorIdType {
2855 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2856 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2857}
2858impl MavOdidOperatorIdType {
2859 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
2860}
2861impl Default for MavOdidOperatorIdType {
2862 fn default() -> Self {
2863 Self::DEFAULT
2864 }
2865}
2866#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2868#[cfg_attr(feature = "serde", serde(tag = "type"))]
2869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2870#[repr(u32)]
2871pub enum MavOdidOperatorLocationType {
2872 #[doc = "The location/altitude of the operator is the same as the take-off location."]
2873 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
2874 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
2875 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
2876 #[doc = "The location/altitude of the operator are fixed values."]
2877 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
2878}
2879impl MavOdidOperatorLocationType {
2880 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
2881}
2882impl Default for MavOdidOperatorLocationType {
2883 fn default() -> Self {
2884 Self::DEFAULT
2885 }
2886}
2887#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2888#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2889#[cfg_attr(feature = "serde", serde(tag = "type"))]
2890#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2891#[repr(u32)]
2892pub enum MavOdidSpeedAcc {
2893 #[doc = "The speed accuracy is unknown."]
2894 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
2895 #[doc = "The speed accuracy is smaller than 10 meters per second."]
2896 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
2897 #[doc = "The speed accuracy is smaller than 3 meters per second."]
2898 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
2899 #[doc = "The speed accuracy is smaller than 1 meters per second."]
2900 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
2901 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
2902 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
2903}
2904impl MavOdidSpeedAcc {
2905 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
2906}
2907impl Default for MavOdidSpeedAcc {
2908 fn default() -> Self {
2909 Self::DEFAULT
2910 }
2911}
2912#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2914#[cfg_attr(feature = "serde", serde(tag = "type"))]
2915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2916#[repr(u32)]
2917pub enum MavOdidStatus {
2918 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
2919 MAV_ODID_STATUS_UNDECLARED = 0,
2920 #[doc = "The UA is on the ground."]
2921 MAV_ODID_STATUS_GROUND = 1,
2922 #[doc = "The UA is in the air."]
2923 MAV_ODID_STATUS_AIRBORNE = 2,
2924 #[doc = "The UA is having an emergency."]
2925 MAV_ODID_STATUS_EMERGENCY = 3,
2926 #[doc = "The remote ID system is failing or unreliable in some way."]
2927 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
2928}
2929impl MavOdidStatus {
2930 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
2931}
2932impl Default for MavOdidStatus {
2933 fn default() -> Self {
2934 Self::DEFAULT
2935 }
2936}
2937#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2939#[cfg_attr(feature = "serde", serde(tag = "type"))]
2940#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2941#[repr(u32)]
2942pub enum MavOdidTimeAcc {
2943 #[doc = "The timestamp accuracy is unknown."]
2944 MAV_ODID_TIME_ACC_UNKNOWN = 0,
2945 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
2946 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
2947 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
2948 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
2949 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
2950 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
2951 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
2952 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
2953 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
2954 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
2955 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
2956 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
2957 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
2958 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
2959 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
2960 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
2961 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
2962 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
2963 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
2964 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
2965 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
2966 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
2967 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
2968 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
2969 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
2970 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
2971 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
2972 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
2973 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
2974 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
2975}
2976impl MavOdidTimeAcc {
2977 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
2978}
2979impl Default for MavOdidTimeAcc {
2980 fn default() -> Self {
2981 Self::DEFAULT
2982 }
2983}
2984#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2986#[cfg_attr(feature = "serde", serde(tag = "type"))]
2987#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2988#[repr(u32)]
2989pub enum MavOdidUaType {
2990 #[doc = "No UA (Unmanned Aircraft) type defined."]
2991 MAV_ODID_UA_TYPE_NONE = 0,
2992 #[doc = "Aeroplane/Airplane. Fixed wing."]
2993 MAV_ODID_UA_TYPE_AEROPLANE = 1,
2994 #[doc = "Helicopter or multirotor."]
2995 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
2996 #[doc = "Gyroplane."]
2997 MAV_ODID_UA_TYPE_GYROPLANE = 3,
2998 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
2999 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3000 #[doc = "Ornithopter."]
3001 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3002 #[doc = "Glider."]
3003 MAV_ODID_UA_TYPE_GLIDER = 6,
3004 #[doc = "Kite."]
3005 MAV_ODID_UA_TYPE_KITE = 7,
3006 #[doc = "Free Balloon."]
3007 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3008 #[doc = "Captive Balloon."]
3009 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3010 #[doc = "Airship. E.g. a blimp."]
3011 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3012 #[doc = "Free Fall/Parachute (unpowered)."]
3013 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3014 #[doc = "Rocket."]
3015 MAV_ODID_UA_TYPE_ROCKET = 12,
3016 #[doc = "Tethered powered aircraft."]
3017 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3018 #[doc = "Ground Obstacle."]
3019 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3020 #[doc = "Other type of aircraft not listed earlier."]
3021 MAV_ODID_UA_TYPE_OTHER = 15,
3022}
3023impl MavOdidUaType {
3024 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3025}
3026impl Default for MavOdidUaType {
3027 fn default() -> Self {
3028 Self::DEFAULT
3029 }
3030}
3031#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3033#[cfg_attr(feature = "serde", serde(tag = "type"))]
3034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3035#[repr(u32)]
3036pub enum MavOdidVerAcc {
3037 #[doc = "The vertical accuracy is unknown."]
3038 MAV_ODID_VER_ACC_UNKNOWN = 0,
3039 #[doc = "The vertical accuracy is smaller than 150 meter."]
3040 MAV_ODID_VER_ACC_150_METER = 1,
3041 #[doc = "The vertical accuracy is smaller than 45 meter."]
3042 MAV_ODID_VER_ACC_45_METER = 2,
3043 #[doc = "The vertical accuracy is smaller than 25 meter."]
3044 MAV_ODID_VER_ACC_25_METER = 3,
3045 #[doc = "The vertical accuracy is smaller than 10 meter."]
3046 MAV_ODID_VER_ACC_10_METER = 4,
3047 #[doc = "The vertical accuracy is smaller than 3 meter."]
3048 MAV_ODID_VER_ACC_3_METER = 5,
3049 #[doc = "The vertical accuracy is smaller than 1 meter."]
3050 MAV_ODID_VER_ACC_1_METER = 6,
3051}
3052impl MavOdidVerAcc {
3053 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3054}
3055impl Default for MavOdidVerAcc {
3056 fn default() -> Self {
3057 Self::DEFAULT
3058 }
3059}
3060#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3062#[cfg_attr(feature = "serde", serde(tag = "type"))]
3063#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3064#[repr(u32)]
3065#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3066pub enum MavParamExtType {
3067 #[doc = "8-bit unsigned integer"]
3068 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3069 #[doc = "8-bit signed integer"]
3070 MAV_PARAM_EXT_TYPE_INT8 = 2,
3071 #[doc = "16-bit unsigned integer"]
3072 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3073 #[doc = "16-bit signed integer"]
3074 MAV_PARAM_EXT_TYPE_INT16 = 4,
3075 #[doc = "32-bit unsigned integer"]
3076 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3077 #[doc = "32-bit signed integer"]
3078 MAV_PARAM_EXT_TYPE_INT32 = 6,
3079 #[doc = "64-bit unsigned integer"]
3080 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3081 #[doc = "64-bit signed integer"]
3082 MAV_PARAM_EXT_TYPE_INT64 = 8,
3083 #[doc = "32-bit floating-point"]
3084 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3085 #[doc = "64-bit floating-point"]
3086 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3087 #[doc = "Custom Type"]
3088 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3089}
3090impl MavParamExtType {
3091 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3092}
3093impl Default for MavParamExtType {
3094 fn default() -> Self {
3095 Self::DEFAULT
3096 }
3097}
3098#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3099#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3100#[cfg_attr(feature = "serde", serde(tag = "type"))]
3101#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3102#[repr(u32)]
3103#[doc = "Specifies the datatype of a MAVLink parameter."]
3104pub enum MavParamType {
3105 #[doc = "8-bit unsigned integer"]
3106 MAV_PARAM_TYPE_UINT8 = 1,
3107 #[doc = "8-bit signed integer"]
3108 MAV_PARAM_TYPE_INT8 = 2,
3109 #[doc = "16-bit unsigned integer"]
3110 MAV_PARAM_TYPE_UINT16 = 3,
3111 #[doc = "16-bit signed integer"]
3112 MAV_PARAM_TYPE_INT16 = 4,
3113 #[doc = "32-bit unsigned integer"]
3114 MAV_PARAM_TYPE_UINT32 = 5,
3115 #[doc = "32-bit signed integer"]
3116 MAV_PARAM_TYPE_INT32 = 6,
3117 #[doc = "64-bit unsigned integer"]
3118 MAV_PARAM_TYPE_UINT64 = 7,
3119 #[doc = "64-bit signed integer"]
3120 MAV_PARAM_TYPE_INT64 = 8,
3121 #[doc = "32-bit floating-point"]
3122 MAV_PARAM_TYPE_REAL32 = 9,
3123 #[doc = "64-bit floating-point"]
3124 MAV_PARAM_TYPE_REAL64 = 10,
3125}
3126impl MavParamType {
3127 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3128}
3129impl Default for MavParamType {
3130 fn default() -> Self {
3131 Self::DEFAULT
3132 }
3133}
3134bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3135impl MavPowerStatus {
3136 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3137}
3138impl Default for MavPowerStatus {
3139 fn default() -> Self {
3140 Self::DEFAULT
3141 }
3142}
3143bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3144impl MavProtocolCapability {
3145 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3146}
3147impl Default for MavProtocolCapability {
3148 fn default() -> Self {
3149 Self::DEFAULT
3150 }
3151}
3152#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3154#[cfg_attr(feature = "serde", serde(tag = "type"))]
3155#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3156#[repr(u32)]
3157#[doc = "Result from a MAVLink command (MAV_CMD)"]
3158pub enum MavResult {
3159 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3160 MAV_RESULT_ACCEPTED = 0,
3161 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3162 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3163 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3164 MAV_RESULT_DENIED = 2,
3165 #[doc = "Command is not supported (unknown)."]
3166 MAV_RESULT_UNSUPPORTED = 3,
3167 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3168 MAV_RESULT_FAILED = 4,
3169 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3170 MAV_RESULT_IN_PROGRESS = 5,
3171 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3172 MAV_RESULT_CANCELLED = 6,
3173 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3174 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3175 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3176 MAV_RESULT_COMMAND_INT_ONLY = 8,
3177 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3178 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3179}
3180impl MavResult {
3181 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3182}
3183impl Default for MavResult {
3184 fn default() -> Self {
3185 Self::DEFAULT
3186 }
3187}
3188#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3189#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3190#[cfg_attr(feature = "serde", serde(tag = "type"))]
3191#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3192#[repr(u32)]
3193#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3194#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3195pub enum MavRoi {
3196 #[doc = "No region of interest."]
3197 MAV_ROI_NONE = 0,
3198 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3199 MAV_ROI_WPNEXT = 1,
3200 #[doc = "Point toward given waypoint."]
3201 MAV_ROI_WPINDEX = 2,
3202 #[doc = "Point toward fixed location."]
3203 MAV_ROI_LOCATION = 3,
3204 #[doc = "Point toward of given id."]
3205 MAV_ROI_TARGET = 4,
3206}
3207impl MavRoi {
3208 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3209}
3210impl Default for MavRoi {
3211 fn default() -> Self {
3212 Self::DEFAULT
3213 }
3214}
3215#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3216#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3217#[cfg_attr(feature = "serde", serde(tag = "type"))]
3218#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3219#[repr(u32)]
3220#[doc = "Enumeration of sensor orientation, according to its rotations"]
3221pub enum MavSensorOrientation {
3222 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3223 MAV_SENSOR_ROTATION_NONE = 0,
3224 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3225 MAV_SENSOR_ROTATION_YAW_45 = 1,
3226 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3227 MAV_SENSOR_ROTATION_YAW_90 = 2,
3228 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3229 MAV_SENSOR_ROTATION_YAW_135 = 3,
3230 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3231 MAV_SENSOR_ROTATION_YAW_180 = 4,
3232 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3233 MAV_SENSOR_ROTATION_YAW_225 = 5,
3234 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3235 MAV_SENSOR_ROTATION_YAW_270 = 6,
3236 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3237 MAV_SENSOR_ROTATION_YAW_315 = 7,
3238 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3239 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3240 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3241 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3242 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3243 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3244 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3245 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3246 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3247 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3248 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3249 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3250 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3251 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3252 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3253 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3254 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3255 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3256 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3257 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3258 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3259 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3260 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3261 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3262 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3263 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3264 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3265 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3266 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3267 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3268 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3269 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3270 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3271 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3272 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3273 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3274 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3275 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3276 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3277 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3278 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3279 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3280 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3281 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3282 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3283 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3284 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3285 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3286 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3287 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3288 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3289 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3290 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3291 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3292 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3293 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3294 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3295 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3296 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3297 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3298 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3299 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3300 #[doc = "Pitch: 315"]
3301 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3302 #[doc = "Roll: 90, Pitch: 315"]
3303 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3304 #[doc = "Custom orientation"]
3305 MAV_SENSOR_ROTATION_CUSTOM = 100,
3306}
3307impl MavSensorOrientation {
3308 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3309}
3310impl Default for MavSensorOrientation {
3311 fn default() -> Self {
3312 Self::DEFAULT
3313 }
3314}
3315#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3316#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3317#[cfg_attr(feature = "serde", serde(tag = "type"))]
3318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3319#[repr(u32)]
3320#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3321pub enum MavSeverity {
3322 #[doc = "System is unusable. This is a \"panic\" condition."]
3323 MAV_SEVERITY_EMERGENCY = 0,
3324 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3325 MAV_SEVERITY_ALERT = 1,
3326 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3327 MAV_SEVERITY_CRITICAL = 2,
3328 #[doc = "Indicates an error in secondary/redundant systems."]
3329 MAV_SEVERITY_ERROR = 3,
3330 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3331 MAV_SEVERITY_WARNING = 4,
3332 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3333 MAV_SEVERITY_NOTICE = 5,
3334 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3335 MAV_SEVERITY_INFO = 6,
3336 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3337 MAV_SEVERITY_DEBUG = 7,
3338}
3339impl MavSeverity {
3340 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3341}
3342impl Default for MavSeverity {
3343 fn default() -> Self {
3344 Self::DEFAULT
3345 }
3346}
3347#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3348#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3349#[cfg_attr(feature = "serde", serde(tag = "type"))]
3350#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3351#[repr(u32)]
3352#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3353pub enum MavStandardMode {
3354 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3355 MAV_STANDARD_MODE_NON_STANDARD = 0,
3356 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3357 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3358 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3359 MAV_STANDARD_MODE_ORBIT = 2,
3360 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3361 MAV_STANDARD_MODE_CRUISE = 3,
3362 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3363 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3364 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3365 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3366 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3367 MAV_STANDARD_MODE_MISSION = 6,
3368 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3369 MAV_STANDARD_MODE_LAND = 7,
3370 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3371 MAV_STANDARD_MODE_TAKEOFF = 8,
3372}
3373impl MavStandardMode {
3374 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3375}
3376impl Default for MavStandardMode {
3377 fn default() -> Self {
3378 Self::DEFAULT
3379 }
3380}
3381#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3383#[cfg_attr(feature = "serde", serde(tag = "type"))]
3384#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3385#[repr(u32)]
3386pub enum MavState {
3387 #[doc = "Uninitialized system, state is unknown."]
3388 MAV_STATE_UNINIT = 0,
3389 #[doc = "System is booting up."]
3390 MAV_STATE_BOOT = 1,
3391 #[doc = "System is calibrating and not flight-ready."]
3392 MAV_STATE_CALIBRATING = 2,
3393 #[doc = "System is grounded and on standby. It can be launched any time."]
3394 MAV_STATE_STANDBY = 3,
3395 #[doc = "System is active and might be already airborne. Motors are engaged."]
3396 MAV_STATE_ACTIVE = 4,
3397 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3398 MAV_STATE_CRITICAL = 5,
3399 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3400 MAV_STATE_EMERGENCY = 6,
3401 #[doc = "System just initialized its power-down sequence, will shut down now."]
3402 MAV_STATE_POWEROFF = 7,
3403 #[doc = "System is terminating itself (failsafe or commanded)."]
3404 MAV_STATE_FLIGHT_TERMINATION = 8,
3405}
3406impl MavState {
3407 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3408}
3409impl Default for MavState {
3410 fn default() -> Self {
3411 Self::DEFAULT
3412 }
3413}
3414bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3415impl MavSysStatusSensor {
3416 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3417}
3418impl Default for MavSysStatusSensor {
3419 fn default() -> Self {
3420 Self::DEFAULT
3421 }
3422}
3423bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3424impl MavSysStatusSensorExtended {
3425 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3426}
3427impl Default for MavSysStatusSensorExtended {
3428 fn default() -> Self {
3429 Self::DEFAULT
3430 }
3431}
3432#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3434#[cfg_attr(feature = "serde", serde(tag = "type"))]
3435#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3436#[repr(u32)]
3437pub enum MavTunnelPayloadType {
3438 #[doc = "Encoding of payload unknown."]
3439 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3440 #[doc = "Registered for STorM32 gimbal controller."]
3441 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3442 #[doc = "Registered for STorM32 gimbal controller."]
3443 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3444 #[doc = "Registered for STorM32 gimbal controller."]
3445 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3446 #[doc = "Registered for STorM32 gimbal controller."]
3447 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3448 #[doc = "Registered for STorM32 gimbal controller."]
3449 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3450 #[doc = "Registered for STorM32 gimbal controller."]
3451 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3452 #[doc = "Registered for STorM32 gimbal controller."]
3453 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3454 #[doc = "Registered for STorM32 gimbal controller."]
3455 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3456 #[doc = "Registered for STorM32 gimbal controller."]
3457 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3458 #[doc = "Registered for STorM32 gimbal controller."]
3459 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3460 #[doc = "Registered for ModalAI remote OSD protocol."]
3461 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3462 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3463 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3464 #[doc = "Registered for ModalAI vendor use."]
3465 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3466}
3467impl MavTunnelPayloadType {
3468 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3469}
3470impl Default for MavTunnelPayloadType {
3471 fn default() -> Self {
3472 Self::DEFAULT
3473 }
3474}
3475#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3476#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3477#[cfg_attr(feature = "serde", serde(tag = "type"))]
3478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3479#[repr(u32)]
3480#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3481pub enum MavType {
3482 #[doc = "Generic micro air vehicle"]
3483 MAV_TYPE_GENERIC = 0,
3484 #[doc = "Fixed wing aircraft."]
3485 MAV_TYPE_FIXED_WING = 1,
3486 #[doc = "Quadrotor"]
3487 MAV_TYPE_QUADROTOR = 2,
3488 #[doc = "Coaxial helicopter"]
3489 MAV_TYPE_COAXIAL = 3,
3490 #[doc = "Normal helicopter with tail rotor."]
3491 MAV_TYPE_HELICOPTER = 4,
3492 #[doc = "Ground installation"]
3493 MAV_TYPE_ANTENNA_TRACKER = 5,
3494 #[doc = "Operator control unit / ground control station"]
3495 MAV_TYPE_GCS = 6,
3496 #[doc = "Airship, controlled"]
3497 MAV_TYPE_AIRSHIP = 7,
3498 #[doc = "Free balloon, uncontrolled"]
3499 MAV_TYPE_FREE_BALLOON = 8,
3500 #[doc = "Rocket"]
3501 MAV_TYPE_ROCKET = 9,
3502 #[doc = "Ground rover"]
3503 MAV_TYPE_GROUND_ROVER = 10,
3504 #[doc = "Surface vessel, boat, ship"]
3505 MAV_TYPE_SURFACE_BOAT = 11,
3506 #[doc = "Submarine"]
3507 MAV_TYPE_SUBMARINE = 12,
3508 #[doc = "Hexarotor"]
3509 MAV_TYPE_HEXAROTOR = 13,
3510 #[doc = "Octorotor"]
3511 MAV_TYPE_OCTOROTOR = 14,
3512 #[doc = "Tricopter"]
3513 MAV_TYPE_TRICOPTER = 15,
3514 #[doc = "Flapping wing"]
3515 MAV_TYPE_FLAPPING_WING = 16,
3516 #[doc = "Kite"]
3517 MAV_TYPE_KITE = 17,
3518 #[doc = "Onboard companion controller"]
3519 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3520 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3521 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3522 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3523 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3524 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3525 MAV_TYPE_VTOL_TILTROTOR = 21,
3526 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3527 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3528 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3529 MAV_TYPE_VTOL_TAILSITTER = 23,
3530 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3531 MAV_TYPE_VTOL_TILTWING = 24,
3532 #[doc = "VTOL reserved 5"]
3533 MAV_TYPE_VTOL_RESERVED5 = 25,
3534 #[doc = "Gimbal"]
3535 MAV_TYPE_GIMBAL = 26,
3536 #[doc = "ADSB system"]
3537 MAV_TYPE_ADSB = 27,
3538 #[doc = "Steerable, nonrigid airfoil"]
3539 MAV_TYPE_PARAFOIL = 28,
3540 #[doc = "Dodecarotor"]
3541 MAV_TYPE_DODECAROTOR = 29,
3542 #[doc = "Camera"]
3543 MAV_TYPE_CAMERA = 30,
3544 #[doc = "Charging station"]
3545 MAV_TYPE_CHARGING_STATION = 31,
3546 #[doc = "FLARM collision avoidance system"]
3547 MAV_TYPE_FLARM = 32,
3548 #[doc = "Servo"]
3549 MAV_TYPE_SERVO = 33,
3550 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3551 MAV_TYPE_ODID = 34,
3552 #[doc = "Decarotor"]
3553 MAV_TYPE_DECAROTOR = 35,
3554 #[doc = "Battery"]
3555 MAV_TYPE_BATTERY = 36,
3556 #[doc = "Parachute"]
3557 MAV_TYPE_PARACHUTE = 37,
3558 #[doc = "Log"]
3559 MAV_TYPE_LOG = 38,
3560 #[doc = "OSD"]
3561 MAV_TYPE_OSD = 39,
3562 #[doc = "IMU"]
3563 MAV_TYPE_IMU = 40,
3564 #[doc = "GPS"]
3565 MAV_TYPE_GPS = 41,
3566 #[doc = "Winch"]
3567 MAV_TYPE_WINCH = 42,
3568 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3569 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3570 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3571 MAV_TYPE_ILLUMINATOR = 44,
3572 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3573 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3574}
3575impl MavType {
3576 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3577}
3578impl Default for MavType {
3579 fn default() -> Self {
3580 Self::DEFAULT
3581 }
3582}
3583#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3584#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3585#[cfg_attr(feature = "serde", serde(tag = "type"))]
3586#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3587#[repr(u32)]
3588#[doc = "Enumeration of VTOL states"]
3589pub enum MavVtolState {
3590 #[doc = "MAV is not configured as VTOL"]
3591 MAV_VTOL_STATE_UNDEFINED = 0,
3592 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3593 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3594 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3595 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3596 #[doc = "VTOL is in multicopter state"]
3597 MAV_VTOL_STATE_MC = 3,
3598 #[doc = "VTOL is in fixed-wing state"]
3599 MAV_VTOL_STATE_FW = 4,
3600}
3601impl MavVtolState {
3602 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3603}
3604impl Default for MavVtolState {
3605 fn default() -> Self {
3606 Self::DEFAULT
3607 }
3608}
3609bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3610impl MavWinchStatusFlag {
3611 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3612}
3613impl Default for MavWinchStatusFlag {
3614 fn default() -> Self {
3615 Self::DEFAULT
3616 }
3617}
3618#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3620#[cfg_attr(feature = "serde", serde(tag = "type"))]
3621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3622#[repr(u32)]
3623pub enum MavlinkDataStreamType {
3624 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3625 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3626 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3627 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3628 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3629 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3630}
3631impl MavlinkDataStreamType {
3632 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3633}
3634impl Default for MavlinkDataStreamType {
3635 fn default() -> Self {
3636 Self::DEFAULT
3637 }
3638}
3639#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3640#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3641#[cfg_attr(feature = "serde", serde(tag = "type"))]
3642#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3643#[repr(u32)]
3644#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3645pub enum MissionState {
3646 #[doc = "The mission status reporting is not supported."]
3647 MISSION_STATE_UNKNOWN = 0,
3648 #[doc = "No mission on the vehicle."]
3649 MISSION_STATE_NO_MISSION = 1,
3650 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3651 MISSION_STATE_NOT_STARTED = 2,
3652 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3653 MISSION_STATE_ACTIVE = 3,
3654 #[doc = "Mission is paused when in auto mode."]
3655 MISSION_STATE_PAUSED = 4,
3656 #[doc = "Mission has executed all mission items."]
3657 MISSION_STATE_COMPLETE = 5,
3658}
3659impl MissionState {
3660 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3661}
3662impl Default for MissionState {
3663 fn default() -> Self {
3664 Self::DEFAULT
3665 }
3666}
3667#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3668#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3669#[cfg_attr(feature = "serde", serde(tag = "type"))]
3670#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3671#[repr(u32)]
3672#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3673pub enum MotorTestOrder {
3674 #[doc = "Default autopilot motor test method."]
3675 MOTOR_TEST_ORDER_DEFAULT = 0,
3676 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3677 MOTOR_TEST_ORDER_SEQUENCE = 1,
3678 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3679 MOTOR_TEST_ORDER_BOARD = 2,
3680}
3681impl MotorTestOrder {
3682 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3683}
3684impl Default for MotorTestOrder {
3685 fn default() -> Self {
3686 Self::DEFAULT
3687 }
3688}
3689#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3690#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3691#[cfg_attr(feature = "serde", serde(tag = "type"))]
3692#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3693#[repr(u32)]
3694#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3695pub enum MotorTestThrottleType {
3696 #[doc = "Throttle as a percentage (0 ~ 100)"]
3697 MOTOR_TEST_THROTTLE_PERCENT = 0,
3698 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3699 MOTOR_TEST_THROTTLE_PWM = 1,
3700 #[doc = "Throttle pass-through from pilot's transmitter."]
3701 MOTOR_TEST_THROTTLE_PILOT = 2,
3702 #[doc = "Per-motor compass calibration test."]
3703 MOTOR_TEST_COMPASS_CAL = 3,
3704}
3705impl MotorTestThrottleType {
3706 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3707}
3708impl Default for MotorTestThrottleType {
3709 fn default() -> Self {
3710 Self::DEFAULT
3711 }
3712}
3713#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3714#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3715#[cfg_attr(feature = "serde", serde(tag = "type"))]
3716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3717#[repr(u32)]
3718pub enum NavVtolLandOptions {
3719 #[doc = "Default autopilot landing behaviour."]
3720 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3721 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3722 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3723 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3724 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3725}
3726impl NavVtolLandOptions {
3727 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3728}
3729impl Default for NavVtolLandOptions {
3730 fn default() -> Self {
3731 Self::DEFAULT
3732 }
3733}
3734#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3735#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3736#[cfg_attr(feature = "serde", serde(tag = "type"))]
3737#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3738#[repr(u32)]
3739#[doc = "Yaw behaviour during orbit flight."]
3740pub enum OrbitYawBehaviour {
3741 #[doc = "Vehicle front points to the center (default)."]
3742 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3743 #[doc = "Vehicle front holds heading when message received."]
3744 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3745 #[doc = "Yaw uncontrolled."]
3746 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3747 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3748 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3749 #[doc = "Yaw controlled by RC input."]
3750 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3751 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3752 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3753}
3754impl OrbitYawBehaviour {
3755 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3756}
3757impl Default for OrbitYawBehaviour {
3758 fn default() -> Self {
3759 Self::DEFAULT
3760 }
3761}
3762#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3763#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3764#[cfg_attr(feature = "serde", serde(tag = "type"))]
3765#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3766#[repr(u32)]
3767#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3768pub enum ParachuteAction {
3769 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3770 PARACHUTE_DISABLE = 0,
3771 #[doc = "Enable auto-release of parachute."]
3772 PARACHUTE_ENABLE = 1,
3773 #[doc = "Release parachute and kill motors."]
3774 PARACHUTE_RELEASE = 2,
3775}
3776impl ParachuteAction {
3777 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3778}
3779impl Default for ParachuteAction {
3780 fn default() -> Self {
3781 Self::DEFAULT
3782 }
3783}
3784#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3785#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3786#[cfg_attr(feature = "serde", serde(tag = "type"))]
3787#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3788#[repr(u32)]
3789#[doc = "Result from PARAM_EXT_SET message."]
3790pub enum ParamAck {
3791 #[doc = "Parameter value ACCEPTED and SET"]
3792 PARAM_ACK_ACCEPTED = 0,
3793 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3794 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3795 #[doc = "Parameter failed to set"]
3796 PARAM_ACK_FAILED = 2,
3797 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3798 PARAM_ACK_IN_PROGRESS = 3,
3799}
3800impl ParamAck {
3801 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3802}
3803impl Default for ParamAck {
3804 fn default() -> Self {
3805 Self::DEFAULT
3806 }
3807}
3808bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3809impl PositionTargetTypemask {
3810 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
3811}
3812impl Default for PositionTargetTypemask {
3813 fn default() -> Self {
3814 Self::DEFAULT
3815 }
3816}
3817#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3819#[cfg_attr(feature = "serde", serde(tag = "type"))]
3820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3821#[repr(u32)]
3822#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
3823pub enum PrecisionLandMode {
3824 #[doc = "Normal (non-precision) landing."]
3825 PRECISION_LAND_MODE_DISABLED = 0,
3826 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
3827 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
3828 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
3829 PRECISION_LAND_MODE_REQUIRED = 2,
3830}
3831impl PrecisionLandMode {
3832 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
3833}
3834impl Default for PrecisionLandMode {
3835 fn default() -> Self {
3836 Self::DEFAULT
3837 }
3838}
3839#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3840#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3841#[cfg_attr(feature = "serde", serde(tag = "type"))]
3842#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3843#[repr(u32)]
3844#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3845pub enum PreflightStorageMissionAction {
3846 #[doc = "Read current mission data from persistent storage"]
3847 MISSION_READ_PERSISTENT = 0,
3848 #[doc = "Write current mission data to persistent storage"]
3849 MISSION_WRITE_PERSISTENT = 1,
3850 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
3851 MISSION_RESET_DEFAULT = 2,
3852}
3853impl PreflightStorageMissionAction {
3854 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
3855}
3856impl Default for PreflightStorageMissionAction {
3857 fn default() -> Self {
3858 Self::DEFAULT
3859 }
3860}
3861#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3862#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3863#[cfg_attr(feature = "serde", serde(tag = "type"))]
3864#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3865#[repr(u32)]
3866#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3867pub enum PreflightStorageParameterAction {
3868 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
3869 PARAM_READ_PERSISTENT = 0,
3870 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
3871 PARAM_WRITE_PERSISTENT = 1,
3872 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
3873 PARAM_RESET_CONFIG_DEFAULT = 2,
3874 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
3875 PARAM_RESET_SENSOR_DEFAULT = 3,
3876 #[doc = "Reset all parameters, including operation counters, to default values"]
3877 PARAM_RESET_ALL_DEFAULT = 4,
3878}
3879impl PreflightStorageParameterAction {
3880 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
3881}
3882impl Default for PreflightStorageParameterAction {
3883 fn default() -> Self {
3884 Self::DEFAULT
3885 }
3886}
3887#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3888#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3889#[cfg_attr(feature = "serde", serde(tag = "type"))]
3890#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3891#[repr(u32)]
3892#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
3893pub enum RcSubType {
3894 #[doc = "Spektrum DSM2"]
3895 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
3896 #[doc = "Spektrum DSMX"]
3897 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
3898 #[doc = "Spektrum DSMX8"]
3899 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
3900}
3901impl RcSubType {
3902 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
3903}
3904impl Default for RcSubType {
3905 fn default() -> Self {
3906 Self::DEFAULT
3907 }
3908}
3909#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3911#[cfg_attr(feature = "serde", serde(tag = "type"))]
3912#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3913#[repr(u32)]
3914#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
3915pub enum RcType {
3916 #[doc = "Spektrum"]
3917 RC_TYPE_SPEKTRUM = 0,
3918 #[doc = "CRSF"]
3919 RC_TYPE_CRSF = 1,
3920}
3921impl RcType {
3922 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
3923}
3924impl Default for RcType {
3925 fn default() -> Self {
3926 Self::DEFAULT
3927 }
3928}
3929#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3931#[cfg_attr(feature = "serde", serde(tag = "type"))]
3932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3933#[repr(u32)]
3934#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
3935pub enum RebootShutdownConditions {
3936 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
3937 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
3938 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
3939 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
3940}
3941impl RebootShutdownConditions {
3942 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
3943}
3944impl Default for RebootShutdownConditions {
3945 fn default() -> Self {
3946 Self::DEFAULT
3947 }
3948}
3949#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3951#[cfg_attr(feature = "serde", serde(tag = "type"))]
3952#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3953#[repr(u32)]
3954#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
3955pub enum RtkBaselineCoordinateSystem {
3956 #[doc = "Earth-centered, Earth-fixed"]
3957 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
3958 #[doc = "RTK basestation centered, north, east, down"]
3959 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
3960}
3961impl RtkBaselineCoordinateSystem {
3962 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
3963}
3964impl Default for RtkBaselineCoordinateSystem {
3965 fn default() -> Self {
3966 Self::DEFAULT
3967 }
3968}
3969#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3970#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3971#[cfg_attr(feature = "serde", serde(tag = "type"))]
3972#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3973#[repr(u32)]
3974#[doc = "Possible safety switch states."]
3975pub enum SafetySwitchState {
3976 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
3977 SAFETY_SWITCH_STATE_SAFE = 0,
3978 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
3979 SAFETY_SWITCH_STATE_DANGEROUS = 1,
3980}
3981impl SafetySwitchState {
3982 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
3983}
3984impl Default for SafetySwitchState {
3985 fn default() -> Self {
3986 Self::DEFAULT
3987 }
3988}
3989#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3990#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3991#[cfg_attr(feature = "serde", serde(tag = "type"))]
3992#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3993#[repr(u32)]
3994#[doc = "SERIAL_CONTROL device types"]
3995pub enum SerialControlDev {
3996 #[doc = "First telemetry port"]
3997 SERIAL_CONTROL_DEV_TELEM1 = 0,
3998 #[doc = "Second telemetry port"]
3999 SERIAL_CONTROL_DEV_TELEM2 = 1,
4000 #[doc = "First GPS port"]
4001 SERIAL_CONTROL_DEV_GPS1 = 2,
4002 #[doc = "Second GPS port"]
4003 SERIAL_CONTROL_DEV_GPS2 = 3,
4004 #[doc = "system shell"]
4005 SERIAL_CONTROL_DEV_SHELL = 10,
4006 #[doc = "SERIAL0"]
4007 SERIAL_CONTROL_SERIAL0 = 100,
4008 #[doc = "SERIAL1"]
4009 SERIAL_CONTROL_SERIAL1 = 101,
4010 #[doc = "SERIAL2"]
4011 SERIAL_CONTROL_SERIAL2 = 102,
4012 #[doc = "SERIAL3"]
4013 SERIAL_CONTROL_SERIAL3 = 103,
4014 #[doc = "SERIAL4"]
4015 SERIAL_CONTROL_SERIAL4 = 104,
4016 #[doc = "SERIAL5"]
4017 SERIAL_CONTROL_SERIAL5 = 105,
4018 #[doc = "SERIAL6"]
4019 SERIAL_CONTROL_SERIAL6 = 106,
4020 #[doc = "SERIAL7"]
4021 SERIAL_CONTROL_SERIAL7 = 107,
4022 #[doc = "SERIAL8"]
4023 SERIAL_CONTROL_SERIAL8 = 108,
4024 #[doc = "SERIAL9"]
4025 SERIAL_CONTROL_SERIAL9 = 109,
4026}
4027impl SerialControlDev {
4028 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4029}
4030impl Default for SerialControlDev {
4031 fn default() -> Self {
4032 Self::DEFAULT
4033 }
4034}
4035bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4036impl SerialControlFlag {
4037 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4038}
4039impl Default for SerialControlFlag {
4040 fn default() -> Self {
4041 Self::DEFAULT
4042 }
4043}
4044#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4045#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4046#[cfg_attr(feature = "serde", serde(tag = "type"))]
4047#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4048#[repr(u32)]
4049#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4050pub enum SetFocusType {
4051 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4052 FOCUS_TYPE_STEP = 0,
4053 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4054 FOCUS_TYPE_CONTINUOUS = 1,
4055 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4056 FOCUS_TYPE_RANGE = 2,
4057 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4058 FOCUS_TYPE_METERS = 3,
4059 #[doc = "Focus automatically."]
4060 FOCUS_TYPE_AUTO = 4,
4061 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4062 FOCUS_TYPE_AUTO_SINGLE = 5,
4063 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4064 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4065}
4066impl SetFocusType {
4067 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4068}
4069impl Default for SetFocusType {
4070 fn default() -> Self {
4071 Self::DEFAULT
4072 }
4073}
4074#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4075#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4076#[cfg_attr(feature = "serde", serde(tag = "type"))]
4077#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4078#[repr(u32)]
4079#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4080pub enum SpeedType {
4081 #[doc = "Airspeed"]
4082 SPEED_TYPE_AIRSPEED = 0,
4083 #[doc = "Groundspeed"]
4084 SPEED_TYPE_GROUNDSPEED = 1,
4085 #[doc = "Climb speed"]
4086 SPEED_TYPE_CLIMB_SPEED = 2,
4087 #[doc = "Descent speed"]
4088 SPEED_TYPE_DESCENT_SPEED = 3,
4089}
4090impl SpeedType {
4091 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4092}
4093impl Default for SpeedType {
4094 fn default() -> Self {
4095 Self::DEFAULT
4096 }
4097}
4098#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4099#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4100#[cfg_attr(feature = "serde", serde(tag = "type"))]
4101#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4102#[repr(u32)]
4103#[doc = "Flags to indicate the status of camera storage."]
4104pub enum StorageStatus {
4105 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4106 STORAGE_STATUS_EMPTY = 0,
4107 #[doc = "Storage present but unformatted."]
4108 STORAGE_STATUS_UNFORMATTED = 1,
4109 #[doc = "Storage present and ready."]
4110 STORAGE_STATUS_READY = 2,
4111 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4112 STORAGE_STATUS_NOT_SUPPORTED = 3,
4113}
4114impl StorageStatus {
4115 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4116}
4117impl Default for StorageStatus {
4118 fn default() -> Self {
4119 Self::DEFAULT
4120 }
4121}
4122#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4123#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4124#[cfg_attr(feature = "serde", serde(tag = "type"))]
4125#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4126#[repr(u32)]
4127#[doc = "Flags to indicate the type of storage."]
4128pub enum StorageType {
4129 #[doc = "Storage type is not known."]
4130 STORAGE_TYPE_UNKNOWN = 0,
4131 #[doc = "Storage type is USB device."]
4132 STORAGE_TYPE_USB_STICK = 1,
4133 #[doc = "Storage type is SD card."]
4134 STORAGE_TYPE_SD = 2,
4135 #[doc = "Storage type is microSD card."]
4136 STORAGE_TYPE_MICROSD = 3,
4137 #[doc = "Storage type is CFast."]
4138 STORAGE_TYPE_CF = 4,
4139 #[doc = "Storage type is CFexpress."]
4140 STORAGE_TYPE_CFE = 5,
4141 #[doc = "Storage type is XQD."]
4142 STORAGE_TYPE_XQD = 6,
4143 #[doc = "Storage type is HD mass storage type."]
4144 STORAGE_TYPE_HD = 7,
4145 #[doc = "Storage type is other, not listed type."]
4146 STORAGE_TYPE_OTHER = 254,
4147}
4148impl StorageType {
4149 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4150}
4151impl Default for StorageType {
4152 fn default() -> Self {
4153 Self::DEFAULT
4154 }
4155}
4156bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4157impl StorageUsageFlag {
4158 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4159}
4160impl Default for StorageUsageFlag {
4161 fn default() -> Self {
4162 Self::DEFAULT
4163 }
4164}
4165#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4166#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4167#[cfg_attr(feature = "serde", serde(tag = "type"))]
4168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4169#[repr(u32)]
4170#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4171pub enum TuneFormat {
4172 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4173 TUNE_FORMAT_QBASIC1_1 = 1,
4174 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4175 TUNE_FORMAT_MML_MODERN = 2,
4176}
4177impl TuneFormat {
4178 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4179}
4180impl Default for TuneFormat {
4181 fn default() -> Self {
4182 Self::DEFAULT
4183 }
4184}
4185#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4186#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4187#[cfg_attr(feature = "serde", serde(tag = "type"))]
4188#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4189#[repr(u32)]
4190#[doc = "Generalized UAVCAN node health"]
4191pub enum UavcanNodeHealth {
4192 #[doc = "The node is functioning properly."]
4193 UAVCAN_NODE_HEALTH_OK = 0,
4194 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4195 UAVCAN_NODE_HEALTH_WARNING = 1,
4196 #[doc = "The node has encountered a major failure."]
4197 UAVCAN_NODE_HEALTH_ERROR = 2,
4198 #[doc = "The node has suffered a fatal malfunction."]
4199 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4200}
4201impl UavcanNodeHealth {
4202 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4203}
4204impl Default for UavcanNodeHealth {
4205 fn default() -> Self {
4206 Self::DEFAULT
4207 }
4208}
4209#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4210#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4211#[cfg_attr(feature = "serde", serde(tag = "type"))]
4212#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4213#[repr(u32)]
4214#[doc = "Generalized UAVCAN node mode"]
4215pub enum UavcanNodeMode {
4216 #[doc = "The node is performing its primary functions."]
4217 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4218 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4219 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4220 #[doc = "The node is under maintenance."]
4221 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4222 #[doc = "The node is in the process of updating its software."]
4223 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4224 #[doc = "The node is no longer available online."]
4225 UAVCAN_NODE_MODE_OFFLINE = 7,
4226}
4227impl UavcanNodeMode {
4228 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4229}
4230impl Default for UavcanNodeMode {
4231 fn default() -> Self {
4232 Self::DEFAULT
4233 }
4234}
4235bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4236impl UtmDataAvailFlags {
4237 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4238}
4239impl Default for UtmDataAvailFlags {
4240 fn default() -> Self {
4241 Self::DEFAULT
4242 }
4243}
4244#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4245#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4246#[cfg_attr(feature = "serde", serde(tag = "type"))]
4247#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4248#[repr(u32)]
4249#[doc = "Airborne status of UAS."]
4250pub enum UtmFlightState {
4251 #[doc = "The flight state can't be determined."]
4252 UTM_FLIGHT_STATE_UNKNOWN = 1,
4253 #[doc = "UAS on ground."]
4254 UTM_FLIGHT_STATE_GROUND = 2,
4255 #[doc = "UAS airborne."]
4256 UTM_FLIGHT_STATE_AIRBORNE = 3,
4257 #[doc = "UAS is in an emergency flight state."]
4258 UTM_FLIGHT_STATE_EMERGENCY = 16,
4259 #[doc = "UAS has no active controls."]
4260 UTM_FLIGHT_STATE_NOCTRL = 32,
4261}
4262impl UtmFlightState {
4263 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4264}
4265impl Default for UtmFlightState {
4266 fn default() -> Self {
4267 Self::DEFAULT
4268 }
4269}
4270#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4272#[cfg_attr(feature = "serde", serde(tag = "type"))]
4273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4274#[repr(u32)]
4275#[doc = "Video stream encodings"]
4276pub enum VideoStreamEncoding {
4277 #[doc = "Stream encoding is unknown"]
4278 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4279 #[doc = "Stream encoding is H.264"]
4280 VIDEO_STREAM_ENCODING_H264 = 1,
4281 #[doc = "Stream encoding is H.265"]
4282 VIDEO_STREAM_ENCODING_H265 = 2,
4283}
4284impl VideoStreamEncoding {
4285 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4286}
4287impl Default for VideoStreamEncoding {
4288 fn default() -> Self {
4289 Self::DEFAULT
4290 }
4291}
4292bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4293impl VideoStreamStatusFlags {
4294 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4295}
4296impl Default for VideoStreamStatusFlags {
4297 fn default() -> Self {
4298 Self::DEFAULT
4299 }
4300}
4301#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4302#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4303#[cfg_attr(feature = "serde", serde(tag = "type"))]
4304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4305#[repr(u32)]
4306#[doc = "Video stream types"]
4307pub enum VideoStreamType {
4308 #[doc = "Stream is RTSP"]
4309 VIDEO_STREAM_TYPE_RTSP = 0,
4310 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4311 VIDEO_STREAM_TYPE_RTPUDP = 1,
4312 #[doc = "Stream is MPEG on TCP"]
4313 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4314 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4315 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4316}
4317impl VideoStreamType {
4318 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4319}
4320impl Default for VideoStreamType {
4321 fn default() -> Self {
4322 Self::DEFAULT
4323 }
4324}
4325#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4326#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4327#[cfg_attr(feature = "serde", serde(tag = "type"))]
4328#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4329#[repr(u32)]
4330#[doc = "Direction of VTOL transition"]
4331pub enum VtolTransitionHeading {
4332 #[doc = "Respect the heading configuration of the vehicle."]
4333 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4334 #[doc = "Use the heading pointing towards the next waypoint."]
4335 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4336 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4337 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4338 #[doc = "Use the specified heading in parameter 4."]
4339 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4340 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4341 VTOL_TRANSITION_HEADING_ANY = 4,
4342}
4343impl VtolTransitionHeading {
4344 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4345}
4346impl Default for VtolTransitionHeading {
4347 fn default() -> Self {
4348 Self::DEFAULT
4349 }
4350}
4351#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4352#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4353#[cfg_attr(feature = "serde", serde(tag = "type"))]
4354#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4355#[repr(u32)]
4356#[doc = "WiFi Mode."]
4357pub enum WifiConfigApMode {
4358 #[doc = "WiFi mode is undefined."]
4359 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4360 #[doc = "WiFi configured as an access point."]
4361 WIFI_CONFIG_AP_MODE_AP = 1,
4362 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4363 WIFI_CONFIG_AP_MODE_STATION = 2,
4364 #[doc = "WiFi disabled."]
4365 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4366}
4367impl WifiConfigApMode {
4368 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4369}
4370impl Default for WifiConfigApMode {
4371 fn default() -> Self {
4372 Self::DEFAULT
4373 }
4374}
4375#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4376#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4377#[cfg_attr(feature = "serde", serde(tag = "type"))]
4378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4379#[repr(u32)]
4380#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4381pub enum WifiConfigApResponse {
4382 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4383 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4384 #[doc = "Changes accepted."]
4385 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4386 #[doc = "Changes rejected."]
4387 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4388 #[doc = "Invalid Mode."]
4389 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4390 #[doc = "Invalid SSID."]
4391 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4392 #[doc = "Invalid Password."]
4393 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4394}
4395impl WifiConfigApResponse {
4396 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4397}
4398impl Default for WifiConfigApResponse {
4399 fn default() -> Self {
4400 Self::DEFAULT
4401 }
4402}
4403#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4405#[cfg_attr(feature = "serde", serde(tag = "type"))]
4406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4407#[repr(u32)]
4408#[doc = "Winch actions."]
4409pub enum WinchActions {
4410 #[doc = "Allow motor to freewheel."]
4411 WINCH_RELAXED = 0,
4412 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4413 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4414 #[doc = "Wind or unwind line at specified rate."]
4415 WINCH_RATE_CONTROL = 2,
4416 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4417 WINCH_LOCK = 3,
4418 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4419 WINCH_DELIVER = 4,
4420 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4421 WINCH_HOLD = 5,
4422 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4423 WINCH_RETRACT = 6,
4424 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4425 WINCH_LOAD_LINE = 7,
4426 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4427 WINCH_ABANDON_LINE = 8,
4428 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4429 WINCH_LOAD_PAYLOAD = 9,
4430}
4431impl WinchActions {
4432 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4433}
4434impl Default for WinchActions {
4435 fn default() -> Self {
4436 Self::DEFAULT
4437 }
4438}
4439#[doc = "Set the vehicle attitude and body angular rates."]
4440#[doc = ""]
4441#[doc = "ID: 140"]
4442#[derive(Debug, Clone, PartialEq)]
4443#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4444#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4445pub struct ACTUATOR_CONTROL_TARGET_DATA {
4446 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4447 pub time_usec: u64,
4448 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4449 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4450 pub controls: [f32; 8],
4451 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4452 pub group_mlx: u8,
4453}
4454impl ACTUATOR_CONTROL_TARGET_DATA {
4455 pub const ENCODED_LEN: usize = 41usize;
4456 pub const DEFAULT: Self = Self {
4457 time_usec: 0_u64,
4458 controls: [0.0_f32; 8usize],
4459 group_mlx: 0_u8,
4460 };
4461 #[cfg(feature = "arbitrary")]
4462 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4463 use arbitrary::{Arbitrary, Unstructured};
4464 let mut buf = [0u8; 1024];
4465 rng.fill_bytes(&mut buf);
4466 let mut unstructured = Unstructured::new(&buf);
4467 Self::arbitrary(&mut unstructured).unwrap_or_default()
4468 }
4469}
4470impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4471 fn default() -> Self {
4472 Self::DEFAULT.clone()
4473 }
4474}
4475impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4476 type Message = MavMessage;
4477 const ID: u32 = 140u32;
4478 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4479 const EXTRA_CRC: u8 = 181u8;
4480 const ENCODED_LEN: usize = 41usize;
4481 fn deser(
4482 _version: MavlinkVersion,
4483 __input: &[u8],
4484 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4485 let avail_len = __input.len();
4486 let mut payload_buf = [0; Self::ENCODED_LEN];
4487 let mut buf = if avail_len < Self::ENCODED_LEN {
4488 payload_buf[0..avail_len].copy_from_slice(__input);
4489 Bytes::new(&payload_buf)
4490 } else {
4491 Bytes::new(__input)
4492 };
4493 let mut __struct = Self::default();
4494 __struct.time_usec = buf.get_u64_le();
4495 for v in &mut __struct.controls {
4496 let val = buf.get_f32_le();
4497 *v = val;
4498 }
4499 __struct.group_mlx = buf.get_u8();
4500 Ok(__struct)
4501 }
4502 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4503 let mut __tmp = BytesMut::new(bytes);
4504 #[allow(clippy::absurd_extreme_comparisons)]
4505 #[allow(unused_comparisons)]
4506 if __tmp.remaining() < Self::ENCODED_LEN {
4507 panic!(
4508 "buffer is too small (need {} bytes, but got {})",
4509 Self::ENCODED_LEN,
4510 __tmp.remaining(),
4511 )
4512 }
4513 __tmp.put_u64_le(self.time_usec);
4514 for val in &self.controls {
4515 __tmp.put_f32_le(*val);
4516 }
4517 __tmp.put_u8(self.group_mlx);
4518 if matches!(version, MavlinkVersion::V2) {
4519 let len = __tmp.len();
4520 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4521 } else {
4522 __tmp.len()
4523 }
4524 }
4525}
4526#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4527#[doc = ""]
4528#[doc = "ID: 375"]
4529#[derive(Debug, Clone, PartialEq)]
4530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4531#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4532pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4533 #[doc = "Timestamp (since system boot)."]
4534 pub time_usec: u64,
4535 #[doc = "Active outputs"]
4536 pub active: u32,
4537 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4538 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4539 pub actuator: [f32; 32],
4540}
4541impl ACTUATOR_OUTPUT_STATUS_DATA {
4542 pub const ENCODED_LEN: usize = 140usize;
4543 pub const DEFAULT: Self = Self {
4544 time_usec: 0_u64,
4545 active: 0_u32,
4546 actuator: [0.0_f32; 32usize],
4547 };
4548 #[cfg(feature = "arbitrary")]
4549 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4550 use arbitrary::{Arbitrary, Unstructured};
4551 let mut buf = [0u8; 1024];
4552 rng.fill_bytes(&mut buf);
4553 let mut unstructured = Unstructured::new(&buf);
4554 Self::arbitrary(&mut unstructured).unwrap_or_default()
4555 }
4556}
4557impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4558 fn default() -> Self {
4559 Self::DEFAULT.clone()
4560 }
4561}
4562impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4563 type Message = MavMessage;
4564 const ID: u32 = 375u32;
4565 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4566 const EXTRA_CRC: u8 = 251u8;
4567 const ENCODED_LEN: usize = 140usize;
4568 fn deser(
4569 _version: MavlinkVersion,
4570 __input: &[u8],
4571 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4572 let avail_len = __input.len();
4573 let mut payload_buf = [0; Self::ENCODED_LEN];
4574 let mut buf = if avail_len < Self::ENCODED_LEN {
4575 payload_buf[0..avail_len].copy_from_slice(__input);
4576 Bytes::new(&payload_buf)
4577 } else {
4578 Bytes::new(__input)
4579 };
4580 let mut __struct = Self::default();
4581 __struct.time_usec = buf.get_u64_le();
4582 __struct.active = buf.get_u32_le();
4583 for v in &mut __struct.actuator {
4584 let val = buf.get_f32_le();
4585 *v = val;
4586 }
4587 Ok(__struct)
4588 }
4589 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4590 let mut __tmp = BytesMut::new(bytes);
4591 #[allow(clippy::absurd_extreme_comparisons)]
4592 #[allow(unused_comparisons)]
4593 if __tmp.remaining() < Self::ENCODED_LEN {
4594 panic!(
4595 "buffer is too small (need {} bytes, but got {})",
4596 Self::ENCODED_LEN,
4597 __tmp.remaining(),
4598 )
4599 }
4600 __tmp.put_u64_le(self.time_usec);
4601 __tmp.put_u32_le(self.active);
4602 for val in &self.actuator {
4603 __tmp.put_f32_le(*val);
4604 }
4605 if matches!(version, MavlinkVersion::V2) {
4606 let len = __tmp.len();
4607 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4608 } else {
4609 __tmp.len()
4610 }
4611 }
4612}
4613#[doc = "The location and information of an ADSB vehicle."]
4614#[doc = ""]
4615#[doc = "ID: 246"]
4616#[derive(Debug, Clone, PartialEq)]
4617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4619pub struct ADSB_VEHICLE_DATA {
4620 #[doc = "ICAO address"]
4621 pub ICAO_address: u32,
4622 #[doc = "Latitude"]
4623 pub lat: i32,
4624 #[doc = "Longitude"]
4625 pub lon: i32,
4626 #[doc = "Altitude(ASL)"]
4627 pub altitude: i32,
4628 #[doc = "Course over ground"]
4629 pub heading: u16,
4630 #[doc = "The horizontal velocity"]
4631 pub hor_velocity: u16,
4632 #[doc = "The vertical velocity. Positive is up"]
4633 pub ver_velocity: i16,
4634 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4635 pub flags: AdsbFlags,
4636 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4637 pub squawk: u16,
4638 #[doc = "ADSB altitude type."]
4639 pub altitude_type: AdsbAltitudeType,
4640 #[doc = "The callsign, 8+null"]
4641 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4642 pub callsign: [u8; 9],
4643 #[doc = "ADSB emitter type."]
4644 pub emitter_type: AdsbEmitterType,
4645 #[doc = "Time since last communication in seconds"]
4646 pub tslc: u8,
4647}
4648impl ADSB_VEHICLE_DATA {
4649 pub const ENCODED_LEN: usize = 38usize;
4650 pub const DEFAULT: Self = Self {
4651 ICAO_address: 0_u32,
4652 lat: 0_i32,
4653 lon: 0_i32,
4654 altitude: 0_i32,
4655 heading: 0_u16,
4656 hor_velocity: 0_u16,
4657 ver_velocity: 0_i16,
4658 flags: AdsbFlags::DEFAULT,
4659 squawk: 0_u16,
4660 altitude_type: AdsbAltitudeType::DEFAULT,
4661 callsign: [0_u8; 9usize],
4662 emitter_type: AdsbEmitterType::DEFAULT,
4663 tslc: 0_u8,
4664 };
4665 #[cfg(feature = "arbitrary")]
4666 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4667 use arbitrary::{Arbitrary, Unstructured};
4668 let mut buf = [0u8; 1024];
4669 rng.fill_bytes(&mut buf);
4670 let mut unstructured = Unstructured::new(&buf);
4671 Self::arbitrary(&mut unstructured).unwrap_or_default()
4672 }
4673}
4674impl Default for ADSB_VEHICLE_DATA {
4675 fn default() -> Self {
4676 Self::DEFAULT.clone()
4677 }
4678}
4679impl MessageData for ADSB_VEHICLE_DATA {
4680 type Message = MavMessage;
4681 const ID: u32 = 246u32;
4682 const NAME: &'static str = "ADSB_VEHICLE";
4683 const EXTRA_CRC: u8 = 184u8;
4684 const ENCODED_LEN: usize = 38usize;
4685 fn deser(
4686 _version: MavlinkVersion,
4687 __input: &[u8],
4688 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4689 let avail_len = __input.len();
4690 let mut payload_buf = [0; Self::ENCODED_LEN];
4691 let mut buf = if avail_len < Self::ENCODED_LEN {
4692 payload_buf[0..avail_len].copy_from_slice(__input);
4693 Bytes::new(&payload_buf)
4694 } else {
4695 Bytes::new(__input)
4696 };
4697 let mut __struct = Self::default();
4698 __struct.ICAO_address = buf.get_u32_le();
4699 __struct.lat = buf.get_i32_le();
4700 __struct.lon = buf.get_i32_le();
4701 __struct.altitude = buf.get_i32_le();
4702 __struct.heading = buf.get_u16_le();
4703 __struct.hor_velocity = buf.get_u16_le();
4704 __struct.ver_velocity = buf.get_i16_le();
4705 let tmp = buf.get_u16_le();
4706 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
4707 ::mavlink_core::error::ParserError::InvalidFlag {
4708 flag_type: "AdsbFlags",
4709 value: tmp as u32,
4710 },
4711 )?;
4712 __struct.squawk = buf.get_u16_le();
4713 let tmp = buf.get_u8();
4714 __struct.altitude_type =
4715 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4716 enum_type: "AdsbAltitudeType",
4717 value: tmp as u32,
4718 })?;
4719 for v in &mut __struct.callsign {
4720 let val = buf.get_u8();
4721 *v = val;
4722 }
4723 let tmp = buf.get_u8();
4724 __struct.emitter_type =
4725 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4726 enum_type: "AdsbEmitterType",
4727 value: tmp as u32,
4728 })?;
4729 __struct.tslc = buf.get_u8();
4730 Ok(__struct)
4731 }
4732 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4733 let mut __tmp = BytesMut::new(bytes);
4734 #[allow(clippy::absurd_extreme_comparisons)]
4735 #[allow(unused_comparisons)]
4736 if __tmp.remaining() < Self::ENCODED_LEN {
4737 panic!(
4738 "buffer is too small (need {} bytes, but got {})",
4739 Self::ENCODED_LEN,
4740 __tmp.remaining(),
4741 )
4742 }
4743 __tmp.put_u32_le(self.ICAO_address);
4744 __tmp.put_i32_le(self.lat);
4745 __tmp.put_i32_le(self.lon);
4746 __tmp.put_i32_le(self.altitude);
4747 __tmp.put_u16_le(self.heading);
4748 __tmp.put_u16_le(self.hor_velocity);
4749 __tmp.put_i16_le(self.ver_velocity);
4750 __tmp.put_u16_le(self.flags.bits());
4751 __tmp.put_u16_le(self.squawk);
4752 __tmp.put_u8(self.altitude_type as u8);
4753 for val in &self.callsign {
4754 __tmp.put_u8(*val);
4755 }
4756 __tmp.put_u8(self.emitter_type as u8);
4757 __tmp.put_u8(self.tslc);
4758 if matches!(version, MavlinkVersion::V2) {
4759 let len = __tmp.len();
4760 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4761 } else {
4762 __tmp.len()
4763 }
4764 }
4765}
4766#[doc = "The location and information of an AIS vessel."]
4767#[doc = ""]
4768#[doc = "ID: 301"]
4769#[derive(Debug, Clone, PartialEq)]
4770#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4771#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4772pub struct AIS_VESSEL_DATA {
4773 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
4774 pub MMSI: u32,
4775 #[doc = "Latitude"]
4776 pub lat: i32,
4777 #[doc = "Longitude"]
4778 pub lon: i32,
4779 #[doc = "Course over ground"]
4780 pub COG: u16,
4781 #[doc = "True heading"]
4782 pub heading: u16,
4783 #[doc = "Speed over ground"]
4784 pub velocity: u16,
4785 #[doc = "Distance from lat/lon location to bow"]
4786 pub dimension_bow: u16,
4787 #[doc = "Distance from lat/lon location to stern"]
4788 pub dimension_stern: u16,
4789 #[doc = "Time since last communication in seconds"]
4790 pub tslc: u16,
4791 #[doc = "Bitmask to indicate various statuses including valid data fields"]
4792 pub flags: AisFlags,
4793 #[doc = "Turn rate"]
4794 pub turn_rate: i8,
4795 #[doc = "Navigational status"]
4796 pub navigational_status: AisNavStatus,
4797 #[doc = "Type of vessels"]
4798 pub mavtype: AisType,
4799 #[doc = "Distance from lat/lon location to port side"]
4800 pub dimension_port: u8,
4801 #[doc = "Distance from lat/lon location to starboard side"]
4802 pub dimension_starboard: u8,
4803 #[doc = "The vessel callsign"]
4804 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4805 pub callsign: [u8; 7],
4806 #[doc = "The vessel name"]
4807 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4808 pub name: [u8; 20],
4809}
4810impl AIS_VESSEL_DATA {
4811 pub const ENCODED_LEN: usize = 58usize;
4812 pub const DEFAULT: Self = Self {
4813 MMSI: 0_u32,
4814 lat: 0_i32,
4815 lon: 0_i32,
4816 COG: 0_u16,
4817 heading: 0_u16,
4818 velocity: 0_u16,
4819 dimension_bow: 0_u16,
4820 dimension_stern: 0_u16,
4821 tslc: 0_u16,
4822 flags: AisFlags::DEFAULT,
4823 turn_rate: 0_i8,
4824 navigational_status: AisNavStatus::DEFAULT,
4825 mavtype: AisType::DEFAULT,
4826 dimension_port: 0_u8,
4827 dimension_starboard: 0_u8,
4828 callsign: [0_u8; 7usize],
4829 name: [0_u8; 20usize],
4830 };
4831 #[cfg(feature = "arbitrary")]
4832 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4833 use arbitrary::{Arbitrary, Unstructured};
4834 let mut buf = [0u8; 1024];
4835 rng.fill_bytes(&mut buf);
4836 let mut unstructured = Unstructured::new(&buf);
4837 Self::arbitrary(&mut unstructured).unwrap_or_default()
4838 }
4839}
4840impl Default for AIS_VESSEL_DATA {
4841 fn default() -> Self {
4842 Self::DEFAULT.clone()
4843 }
4844}
4845impl MessageData for AIS_VESSEL_DATA {
4846 type Message = MavMessage;
4847 const ID: u32 = 301u32;
4848 const NAME: &'static str = "AIS_VESSEL";
4849 const EXTRA_CRC: u8 = 243u8;
4850 const ENCODED_LEN: usize = 58usize;
4851 fn deser(
4852 _version: MavlinkVersion,
4853 __input: &[u8],
4854 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4855 let avail_len = __input.len();
4856 let mut payload_buf = [0; Self::ENCODED_LEN];
4857 let mut buf = if avail_len < Self::ENCODED_LEN {
4858 payload_buf[0..avail_len].copy_from_slice(__input);
4859 Bytes::new(&payload_buf)
4860 } else {
4861 Bytes::new(__input)
4862 };
4863 let mut __struct = Self::default();
4864 __struct.MMSI = buf.get_u32_le();
4865 __struct.lat = buf.get_i32_le();
4866 __struct.lon = buf.get_i32_le();
4867 __struct.COG = buf.get_u16_le();
4868 __struct.heading = buf.get_u16_le();
4869 __struct.velocity = buf.get_u16_le();
4870 __struct.dimension_bow = buf.get_u16_le();
4871 __struct.dimension_stern = buf.get_u16_le();
4872 __struct.tslc = buf.get_u16_le();
4873 let tmp = buf.get_u16_le();
4874 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
4875 ::mavlink_core::error::ParserError::InvalidFlag {
4876 flag_type: "AisFlags",
4877 value: tmp as u32,
4878 },
4879 )?;
4880 __struct.turn_rate = buf.get_i8();
4881 let tmp = buf.get_u8();
4882 __struct.navigational_status =
4883 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4884 enum_type: "AisNavStatus",
4885 value: tmp as u32,
4886 })?;
4887 let tmp = buf.get_u8();
4888 __struct.mavtype =
4889 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4890 enum_type: "AisType",
4891 value: tmp as u32,
4892 })?;
4893 __struct.dimension_port = buf.get_u8();
4894 __struct.dimension_starboard = buf.get_u8();
4895 for v in &mut __struct.callsign {
4896 let val = buf.get_u8();
4897 *v = val;
4898 }
4899 for v in &mut __struct.name {
4900 let val = buf.get_u8();
4901 *v = val;
4902 }
4903 Ok(__struct)
4904 }
4905 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4906 let mut __tmp = BytesMut::new(bytes);
4907 #[allow(clippy::absurd_extreme_comparisons)]
4908 #[allow(unused_comparisons)]
4909 if __tmp.remaining() < Self::ENCODED_LEN {
4910 panic!(
4911 "buffer is too small (need {} bytes, but got {})",
4912 Self::ENCODED_LEN,
4913 __tmp.remaining(),
4914 )
4915 }
4916 __tmp.put_u32_le(self.MMSI);
4917 __tmp.put_i32_le(self.lat);
4918 __tmp.put_i32_le(self.lon);
4919 __tmp.put_u16_le(self.COG);
4920 __tmp.put_u16_le(self.heading);
4921 __tmp.put_u16_le(self.velocity);
4922 __tmp.put_u16_le(self.dimension_bow);
4923 __tmp.put_u16_le(self.dimension_stern);
4924 __tmp.put_u16_le(self.tslc);
4925 __tmp.put_u16_le(self.flags.bits());
4926 __tmp.put_i8(self.turn_rate);
4927 __tmp.put_u8(self.navigational_status as u8);
4928 __tmp.put_u8(self.mavtype as u8);
4929 __tmp.put_u8(self.dimension_port);
4930 __tmp.put_u8(self.dimension_starboard);
4931 for val in &self.callsign {
4932 __tmp.put_u8(*val);
4933 }
4934 for val in &self.name {
4935 __tmp.put_u8(*val);
4936 }
4937 if matches!(version, MavlinkVersion::V2) {
4938 let len = __tmp.len();
4939 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4940 } else {
4941 __tmp.len()
4942 }
4943 }
4944}
4945#[doc = "The current system altitude."]
4946#[doc = ""]
4947#[doc = "ID: 141"]
4948#[derive(Debug, Clone, PartialEq)]
4949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4950#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4951pub struct ALTITUDE_DATA {
4952 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4953 pub time_usec: u64,
4954 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
4955 pub altitude_monotonic: f32,
4956 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
4957 pub altitude_amsl: f32,
4958 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
4959 pub altitude_local: f32,
4960 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
4961 pub altitude_relative: f32,
4962 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
4963 pub altitude_terrain: f32,
4964 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
4965 pub bottom_clearance: f32,
4966}
4967impl ALTITUDE_DATA {
4968 pub const ENCODED_LEN: usize = 32usize;
4969 pub const DEFAULT: Self = Self {
4970 time_usec: 0_u64,
4971 altitude_monotonic: 0.0_f32,
4972 altitude_amsl: 0.0_f32,
4973 altitude_local: 0.0_f32,
4974 altitude_relative: 0.0_f32,
4975 altitude_terrain: 0.0_f32,
4976 bottom_clearance: 0.0_f32,
4977 };
4978 #[cfg(feature = "arbitrary")]
4979 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4980 use arbitrary::{Arbitrary, Unstructured};
4981 let mut buf = [0u8; 1024];
4982 rng.fill_bytes(&mut buf);
4983 let mut unstructured = Unstructured::new(&buf);
4984 Self::arbitrary(&mut unstructured).unwrap_or_default()
4985 }
4986}
4987impl Default for ALTITUDE_DATA {
4988 fn default() -> Self {
4989 Self::DEFAULT.clone()
4990 }
4991}
4992impl MessageData for ALTITUDE_DATA {
4993 type Message = MavMessage;
4994 const ID: u32 = 141u32;
4995 const NAME: &'static str = "ALTITUDE";
4996 const EXTRA_CRC: u8 = 47u8;
4997 const ENCODED_LEN: usize = 32usize;
4998 fn deser(
4999 _version: MavlinkVersion,
5000 __input: &[u8],
5001 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5002 let avail_len = __input.len();
5003 let mut payload_buf = [0; Self::ENCODED_LEN];
5004 let mut buf = if avail_len < Self::ENCODED_LEN {
5005 payload_buf[0..avail_len].copy_from_slice(__input);
5006 Bytes::new(&payload_buf)
5007 } else {
5008 Bytes::new(__input)
5009 };
5010 let mut __struct = Self::default();
5011 __struct.time_usec = buf.get_u64_le();
5012 __struct.altitude_monotonic = buf.get_f32_le();
5013 __struct.altitude_amsl = buf.get_f32_le();
5014 __struct.altitude_local = buf.get_f32_le();
5015 __struct.altitude_relative = buf.get_f32_le();
5016 __struct.altitude_terrain = buf.get_f32_le();
5017 __struct.bottom_clearance = buf.get_f32_le();
5018 Ok(__struct)
5019 }
5020 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5021 let mut __tmp = BytesMut::new(bytes);
5022 #[allow(clippy::absurd_extreme_comparisons)]
5023 #[allow(unused_comparisons)]
5024 if __tmp.remaining() < Self::ENCODED_LEN {
5025 panic!(
5026 "buffer is too small (need {} bytes, but got {})",
5027 Self::ENCODED_LEN,
5028 __tmp.remaining(),
5029 )
5030 }
5031 __tmp.put_u64_le(self.time_usec);
5032 __tmp.put_f32_le(self.altitude_monotonic);
5033 __tmp.put_f32_le(self.altitude_amsl);
5034 __tmp.put_f32_le(self.altitude_local);
5035 __tmp.put_f32_le(self.altitude_relative);
5036 __tmp.put_f32_le(self.altitude_terrain);
5037 __tmp.put_f32_le(self.bottom_clearance);
5038 if matches!(version, MavlinkVersion::V2) {
5039 let len = __tmp.len();
5040 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5041 } else {
5042 __tmp.len()
5043 }
5044 }
5045}
5046#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5047#[doc = ""]
5048#[doc = "ID: 30"]
5049#[derive(Debug, Clone, PartialEq)]
5050#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5051#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5052pub struct ATTITUDE_DATA {
5053 #[doc = "Timestamp (time since system boot)."]
5054 pub time_boot_ms: u32,
5055 #[doc = "Roll angle (-pi..+pi)"]
5056 pub roll: f32,
5057 #[doc = "Pitch angle (-pi..+pi)"]
5058 pub pitch: f32,
5059 #[doc = "Yaw angle (-pi..+pi)"]
5060 pub yaw: f32,
5061 #[doc = "Roll angular speed"]
5062 pub rollspeed: f32,
5063 #[doc = "Pitch angular speed"]
5064 pub pitchspeed: f32,
5065 #[doc = "Yaw angular speed"]
5066 pub yawspeed: f32,
5067}
5068impl ATTITUDE_DATA {
5069 pub const ENCODED_LEN: usize = 28usize;
5070 pub const DEFAULT: Self = Self {
5071 time_boot_ms: 0_u32,
5072 roll: 0.0_f32,
5073 pitch: 0.0_f32,
5074 yaw: 0.0_f32,
5075 rollspeed: 0.0_f32,
5076 pitchspeed: 0.0_f32,
5077 yawspeed: 0.0_f32,
5078 };
5079 #[cfg(feature = "arbitrary")]
5080 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5081 use arbitrary::{Arbitrary, Unstructured};
5082 let mut buf = [0u8; 1024];
5083 rng.fill_bytes(&mut buf);
5084 let mut unstructured = Unstructured::new(&buf);
5085 Self::arbitrary(&mut unstructured).unwrap_or_default()
5086 }
5087}
5088impl Default for ATTITUDE_DATA {
5089 fn default() -> Self {
5090 Self::DEFAULT.clone()
5091 }
5092}
5093impl MessageData for ATTITUDE_DATA {
5094 type Message = MavMessage;
5095 const ID: u32 = 30u32;
5096 const NAME: &'static str = "ATTITUDE";
5097 const EXTRA_CRC: u8 = 39u8;
5098 const ENCODED_LEN: usize = 28usize;
5099 fn deser(
5100 _version: MavlinkVersion,
5101 __input: &[u8],
5102 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5103 let avail_len = __input.len();
5104 let mut payload_buf = [0; Self::ENCODED_LEN];
5105 let mut buf = if avail_len < Self::ENCODED_LEN {
5106 payload_buf[0..avail_len].copy_from_slice(__input);
5107 Bytes::new(&payload_buf)
5108 } else {
5109 Bytes::new(__input)
5110 };
5111 let mut __struct = Self::default();
5112 __struct.time_boot_ms = buf.get_u32_le();
5113 __struct.roll = buf.get_f32_le();
5114 __struct.pitch = buf.get_f32_le();
5115 __struct.yaw = buf.get_f32_le();
5116 __struct.rollspeed = buf.get_f32_le();
5117 __struct.pitchspeed = buf.get_f32_le();
5118 __struct.yawspeed = buf.get_f32_le();
5119 Ok(__struct)
5120 }
5121 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5122 let mut __tmp = BytesMut::new(bytes);
5123 #[allow(clippy::absurd_extreme_comparisons)]
5124 #[allow(unused_comparisons)]
5125 if __tmp.remaining() < Self::ENCODED_LEN {
5126 panic!(
5127 "buffer is too small (need {} bytes, but got {})",
5128 Self::ENCODED_LEN,
5129 __tmp.remaining(),
5130 )
5131 }
5132 __tmp.put_u32_le(self.time_boot_ms);
5133 __tmp.put_f32_le(self.roll);
5134 __tmp.put_f32_le(self.pitch);
5135 __tmp.put_f32_le(self.yaw);
5136 __tmp.put_f32_le(self.rollspeed);
5137 __tmp.put_f32_le(self.pitchspeed);
5138 __tmp.put_f32_le(self.yawspeed);
5139 if matches!(version, MavlinkVersion::V2) {
5140 let len = __tmp.len();
5141 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5142 } else {
5143 __tmp.len()
5144 }
5145 }
5146}
5147#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5148#[doc = ""]
5149#[doc = "ID: 31"]
5150#[derive(Debug, Clone, PartialEq)]
5151#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5152#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5153pub struct ATTITUDE_QUATERNION_DATA {
5154 #[doc = "Timestamp (time since system boot)."]
5155 pub time_boot_ms: u32,
5156 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5157 pub q1: f32,
5158 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5159 pub q2: f32,
5160 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5161 pub q3: f32,
5162 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5163 pub q4: f32,
5164 #[doc = "Roll angular speed"]
5165 pub rollspeed: f32,
5166 #[doc = "Pitch angular speed"]
5167 pub pitchspeed: f32,
5168 #[doc = "Yaw angular speed"]
5169 pub yawspeed: f32,
5170 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5171 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5172 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5173 pub repr_offset_q: [f32; 4],
5174}
5175impl ATTITUDE_QUATERNION_DATA {
5176 pub const ENCODED_LEN: usize = 48usize;
5177 pub const DEFAULT: Self = Self {
5178 time_boot_ms: 0_u32,
5179 q1: 0.0_f32,
5180 q2: 0.0_f32,
5181 q3: 0.0_f32,
5182 q4: 0.0_f32,
5183 rollspeed: 0.0_f32,
5184 pitchspeed: 0.0_f32,
5185 yawspeed: 0.0_f32,
5186 repr_offset_q: [0.0_f32; 4usize],
5187 };
5188 #[cfg(feature = "arbitrary")]
5189 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5190 use arbitrary::{Arbitrary, Unstructured};
5191 let mut buf = [0u8; 1024];
5192 rng.fill_bytes(&mut buf);
5193 let mut unstructured = Unstructured::new(&buf);
5194 Self::arbitrary(&mut unstructured).unwrap_or_default()
5195 }
5196}
5197impl Default for ATTITUDE_QUATERNION_DATA {
5198 fn default() -> Self {
5199 Self::DEFAULT.clone()
5200 }
5201}
5202impl MessageData for ATTITUDE_QUATERNION_DATA {
5203 type Message = MavMessage;
5204 const ID: u32 = 31u32;
5205 const NAME: &'static str = "ATTITUDE_QUATERNION";
5206 const EXTRA_CRC: u8 = 246u8;
5207 const ENCODED_LEN: usize = 48usize;
5208 fn deser(
5209 _version: MavlinkVersion,
5210 __input: &[u8],
5211 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5212 let avail_len = __input.len();
5213 let mut payload_buf = [0; Self::ENCODED_LEN];
5214 let mut buf = if avail_len < Self::ENCODED_LEN {
5215 payload_buf[0..avail_len].copy_from_slice(__input);
5216 Bytes::new(&payload_buf)
5217 } else {
5218 Bytes::new(__input)
5219 };
5220 let mut __struct = Self::default();
5221 __struct.time_boot_ms = buf.get_u32_le();
5222 __struct.q1 = buf.get_f32_le();
5223 __struct.q2 = buf.get_f32_le();
5224 __struct.q3 = buf.get_f32_le();
5225 __struct.q4 = buf.get_f32_le();
5226 __struct.rollspeed = buf.get_f32_le();
5227 __struct.pitchspeed = buf.get_f32_le();
5228 __struct.yawspeed = buf.get_f32_le();
5229 for v in &mut __struct.repr_offset_q {
5230 let val = buf.get_f32_le();
5231 *v = val;
5232 }
5233 Ok(__struct)
5234 }
5235 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5236 let mut __tmp = BytesMut::new(bytes);
5237 #[allow(clippy::absurd_extreme_comparisons)]
5238 #[allow(unused_comparisons)]
5239 if __tmp.remaining() < Self::ENCODED_LEN {
5240 panic!(
5241 "buffer is too small (need {} bytes, but got {})",
5242 Self::ENCODED_LEN,
5243 __tmp.remaining(),
5244 )
5245 }
5246 __tmp.put_u32_le(self.time_boot_ms);
5247 __tmp.put_f32_le(self.q1);
5248 __tmp.put_f32_le(self.q2);
5249 __tmp.put_f32_le(self.q3);
5250 __tmp.put_f32_le(self.q4);
5251 __tmp.put_f32_le(self.rollspeed);
5252 __tmp.put_f32_le(self.pitchspeed);
5253 __tmp.put_f32_le(self.yawspeed);
5254 if matches!(version, MavlinkVersion::V2) {
5255 for val in &self.repr_offset_q {
5256 __tmp.put_f32_le(*val);
5257 }
5258 let len = __tmp.len();
5259 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5260 } else {
5261 __tmp.len()
5262 }
5263 }
5264}
5265#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5266#[doc = ""]
5267#[doc = "ID: 61"]
5268#[derive(Debug, Clone, PartialEq)]
5269#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5270#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5271pub struct ATTITUDE_QUATERNION_COV_DATA {
5272 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5273 pub time_usec: u64,
5274 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5275 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5276 pub q: [f32; 4],
5277 #[doc = "Roll angular speed"]
5278 pub rollspeed: f32,
5279 #[doc = "Pitch angular speed"]
5280 pub pitchspeed: f32,
5281 #[doc = "Yaw angular speed"]
5282 pub yawspeed: f32,
5283 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5284 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5285 pub covariance: [f32; 9],
5286}
5287impl ATTITUDE_QUATERNION_COV_DATA {
5288 pub const ENCODED_LEN: usize = 72usize;
5289 pub const DEFAULT: Self = Self {
5290 time_usec: 0_u64,
5291 q: [0.0_f32; 4usize],
5292 rollspeed: 0.0_f32,
5293 pitchspeed: 0.0_f32,
5294 yawspeed: 0.0_f32,
5295 covariance: [0.0_f32; 9usize],
5296 };
5297 #[cfg(feature = "arbitrary")]
5298 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5299 use arbitrary::{Arbitrary, Unstructured};
5300 let mut buf = [0u8; 1024];
5301 rng.fill_bytes(&mut buf);
5302 let mut unstructured = Unstructured::new(&buf);
5303 Self::arbitrary(&mut unstructured).unwrap_or_default()
5304 }
5305}
5306impl Default for ATTITUDE_QUATERNION_COV_DATA {
5307 fn default() -> Self {
5308 Self::DEFAULT.clone()
5309 }
5310}
5311impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5312 type Message = MavMessage;
5313 const ID: u32 = 61u32;
5314 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5315 const EXTRA_CRC: u8 = 167u8;
5316 const ENCODED_LEN: usize = 72usize;
5317 fn deser(
5318 _version: MavlinkVersion,
5319 __input: &[u8],
5320 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5321 let avail_len = __input.len();
5322 let mut payload_buf = [0; Self::ENCODED_LEN];
5323 let mut buf = if avail_len < Self::ENCODED_LEN {
5324 payload_buf[0..avail_len].copy_from_slice(__input);
5325 Bytes::new(&payload_buf)
5326 } else {
5327 Bytes::new(__input)
5328 };
5329 let mut __struct = Self::default();
5330 __struct.time_usec = buf.get_u64_le();
5331 for v in &mut __struct.q {
5332 let val = buf.get_f32_le();
5333 *v = val;
5334 }
5335 __struct.rollspeed = buf.get_f32_le();
5336 __struct.pitchspeed = buf.get_f32_le();
5337 __struct.yawspeed = buf.get_f32_le();
5338 for v in &mut __struct.covariance {
5339 let val = buf.get_f32_le();
5340 *v = val;
5341 }
5342 Ok(__struct)
5343 }
5344 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5345 let mut __tmp = BytesMut::new(bytes);
5346 #[allow(clippy::absurd_extreme_comparisons)]
5347 #[allow(unused_comparisons)]
5348 if __tmp.remaining() < Self::ENCODED_LEN {
5349 panic!(
5350 "buffer is too small (need {} bytes, but got {})",
5351 Self::ENCODED_LEN,
5352 __tmp.remaining(),
5353 )
5354 }
5355 __tmp.put_u64_le(self.time_usec);
5356 for val in &self.q {
5357 __tmp.put_f32_le(*val);
5358 }
5359 __tmp.put_f32_le(self.rollspeed);
5360 __tmp.put_f32_le(self.pitchspeed);
5361 __tmp.put_f32_le(self.yawspeed);
5362 for val in &self.covariance {
5363 __tmp.put_f32_le(*val);
5364 }
5365 if matches!(version, MavlinkVersion::V2) {
5366 let len = __tmp.len();
5367 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5368 } else {
5369 __tmp.len()
5370 }
5371 }
5372}
5373#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5374#[doc = ""]
5375#[doc = "ID: 83"]
5376#[derive(Debug, Clone, PartialEq)]
5377#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5379pub struct ATTITUDE_TARGET_DATA {
5380 #[doc = "Timestamp (time since system boot)."]
5381 pub time_boot_ms: u32,
5382 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5383 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5384 pub q: [f32; 4],
5385 #[doc = "Body roll rate"]
5386 pub body_roll_rate: f32,
5387 #[doc = "Body pitch rate"]
5388 pub body_pitch_rate: f32,
5389 #[doc = "Body yaw rate"]
5390 pub body_yaw_rate: f32,
5391 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5392 pub thrust: f32,
5393 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5394 pub type_mask: AttitudeTargetTypemask,
5395}
5396impl ATTITUDE_TARGET_DATA {
5397 pub const ENCODED_LEN: usize = 37usize;
5398 pub const DEFAULT: Self = Self {
5399 time_boot_ms: 0_u32,
5400 q: [0.0_f32; 4usize],
5401 body_roll_rate: 0.0_f32,
5402 body_pitch_rate: 0.0_f32,
5403 body_yaw_rate: 0.0_f32,
5404 thrust: 0.0_f32,
5405 type_mask: AttitudeTargetTypemask::DEFAULT,
5406 };
5407 #[cfg(feature = "arbitrary")]
5408 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5409 use arbitrary::{Arbitrary, Unstructured};
5410 let mut buf = [0u8; 1024];
5411 rng.fill_bytes(&mut buf);
5412 let mut unstructured = Unstructured::new(&buf);
5413 Self::arbitrary(&mut unstructured).unwrap_or_default()
5414 }
5415}
5416impl Default for ATTITUDE_TARGET_DATA {
5417 fn default() -> Self {
5418 Self::DEFAULT.clone()
5419 }
5420}
5421impl MessageData for ATTITUDE_TARGET_DATA {
5422 type Message = MavMessage;
5423 const ID: u32 = 83u32;
5424 const NAME: &'static str = "ATTITUDE_TARGET";
5425 const EXTRA_CRC: u8 = 22u8;
5426 const ENCODED_LEN: usize = 37usize;
5427 fn deser(
5428 _version: MavlinkVersion,
5429 __input: &[u8],
5430 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5431 let avail_len = __input.len();
5432 let mut payload_buf = [0; Self::ENCODED_LEN];
5433 let mut buf = if avail_len < Self::ENCODED_LEN {
5434 payload_buf[0..avail_len].copy_from_slice(__input);
5435 Bytes::new(&payload_buf)
5436 } else {
5437 Bytes::new(__input)
5438 };
5439 let mut __struct = Self::default();
5440 __struct.time_boot_ms = buf.get_u32_le();
5441 for v in &mut __struct.q {
5442 let val = buf.get_f32_le();
5443 *v = val;
5444 }
5445 __struct.body_roll_rate = buf.get_f32_le();
5446 __struct.body_pitch_rate = buf.get_f32_le();
5447 __struct.body_yaw_rate = buf.get_f32_le();
5448 __struct.thrust = buf.get_f32_le();
5449 let tmp = buf.get_u8();
5450 __struct.type_mask = AttitudeTargetTypemask::from_bits(
5451 tmp & AttitudeTargetTypemask::all().bits(),
5452 )
5453 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5454 flag_type: "AttitudeTargetTypemask",
5455 value: tmp as u32,
5456 })?;
5457 Ok(__struct)
5458 }
5459 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5460 let mut __tmp = BytesMut::new(bytes);
5461 #[allow(clippy::absurd_extreme_comparisons)]
5462 #[allow(unused_comparisons)]
5463 if __tmp.remaining() < Self::ENCODED_LEN {
5464 panic!(
5465 "buffer is too small (need {} bytes, but got {})",
5466 Self::ENCODED_LEN,
5467 __tmp.remaining(),
5468 )
5469 }
5470 __tmp.put_u32_le(self.time_boot_ms);
5471 for val in &self.q {
5472 __tmp.put_f32_le(*val);
5473 }
5474 __tmp.put_f32_le(self.body_roll_rate);
5475 __tmp.put_f32_le(self.body_pitch_rate);
5476 __tmp.put_f32_le(self.body_yaw_rate);
5477 __tmp.put_f32_le(self.thrust);
5478 __tmp.put_u8(self.type_mask.bits());
5479 if matches!(version, MavlinkVersion::V2) {
5480 let len = __tmp.len();
5481 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5482 } else {
5483 __tmp.len()
5484 }
5485 }
5486}
5487#[doc = "Motion capture attitude and position."]
5488#[doc = ""]
5489#[doc = "ID: 138"]
5490#[derive(Debug, Clone, PartialEq)]
5491#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5492#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5493pub struct ATT_POS_MOCAP_DATA {
5494 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5495 pub time_usec: u64,
5496 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5497 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5498 pub q: [f32; 4],
5499 #[doc = "X position (NED)"]
5500 pub x: f32,
5501 #[doc = "Y position (NED)"]
5502 pub y: f32,
5503 #[doc = "Z position (NED)"]
5504 pub z: f32,
5505 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5506 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5507 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5508 pub covariance: [f32; 21],
5509}
5510impl ATT_POS_MOCAP_DATA {
5511 pub const ENCODED_LEN: usize = 120usize;
5512 pub const DEFAULT: Self = Self {
5513 time_usec: 0_u64,
5514 q: [0.0_f32; 4usize],
5515 x: 0.0_f32,
5516 y: 0.0_f32,
5517 z: 0.0_f32,
5518 covariance: [0.0_f32; 21usize],
5519 };
5520 #[cfg(feature = "arbitrary")]
5521 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5522 use arbitrary::{Arbitrary, Unstructured};
5523 let mut buf = [0u8; 1024];
5524 rng.fill_bytes(&mut buf);
5525 let mut unstructured = Unstructured::new(&buf);
5526 Self::arbitrary(&mut unstructured).unwrap_or_default()
5527 }
5528}
5529impl Default for ATT_POS_MOCAP_DATA {
5530 fn default() -> Self {
5531 Self::DEFAULT.clone()
5532 }
5533}
5534impl MessageData for ATT_POS_MOCAP_DATA {
5535 type Message = MavMessage;
5536 const ID: u32 = 138u32;
5537 const NAME: &'static str = "ATT_POS_MOCAP";
5538 const EXTRA_CRC: u8 = 109u8;
5539 const ENCODED_LEN: usize = 120usize;
5540 fn deser(
5541 _version: MavlinkVersion,
5542 __input: &[u8],
5543 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5544 let avail_len = __input.len();
5545 let mut payload_buf = [0; Self::ENCODED_LEN];
5546 let mut buf = if avail_len < Self::ENCODED_LEN {
5547 payload_buf[0..avail_len].copy_from_slice(__input);
5548 Bytes::new(&payload_buf)
5549 } else {
5550 Bytes::new(__input)
5551 };
5552 let mut __struct = Self::default();
5553 __struct.time_usec = buf.get_u64_le();
5554 for v in &mut __struct.q {
5555 let val = buf.get_f32_le();
5556 *v = val;
5557 }
5558 __struct.x = buf.get_f32_le();
5559 __struct.y = buf.get_f32_le();
5560 __struct.z = buf.get_f32_le();
5561 for v in &mut __struct.covariance {
5562 let val = buf.get_f32_le();
5563 *v = val;
5564 }
5565 Ok(__struct)
5566 }
5567 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5568 let mut __tmp = BytesMut::new(bytes);
5569 #[allow(clippy::absurd_extreme_comparisons)]
5570 #[allow(unused_comparisons)]
5571 if __tmp.remaining() < Self::ENCODED_LEN {
5572 panic!(
5573 "buffer is too small (need {} bytes, but got {})",
5574 Self::ENCODED_LEN,
5575 __tmp.remaining(),
5576 )
5577 }
5578 __tmp.put_u64_le(self.time_usec);
5579 for val in &self.q {
5580 __tmp.put_f32_le(*val);
5581 }
5582 __tmp.put_f32_le(self.x);
5583 __tmp.put_f32_le(self.y);
5584 __tmp.put_f32_le(self.z);
5585 if matches!(version, MavlinkVersion::V2) {
5586 for val in &self.covariance {
5587 __tmp.put_f32_le(*val);
5588 }
5589 let len = __tmp.len();
5590 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5591 } else {
5592 __tmp.len()
5593 }
5594 }
5595}
5596#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5597#[doc = ""]
5598#[doc = "ID: 7"]
5599#[derive(Debug, Clone, PartialEq)]
5600#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5601#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5602pub struct AUTH_KEY_DATA {
5603 #[doc = "key"]
5604 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5605 pub key: [u8; 32],
5606}
5607impl AUTH_KEY_DATA {
5608 pub const ENCODED_LEN: usize = 32usize;
5609 pub const DEFAULT: Self = Self {
5610 key: [0_u8; 32usize],
5611 };
5612 #[cfg(feature = "arbitrary")]
5613 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5614 use arbitrary::{Arbitrary, Unstructured};
5615 let mut buf = [0u8; 1024];
5616 rng.fill_bytes(&mut buf);
5617 let mut unstructured = Unstructured::new(&buf);
5618 Self::arbitrary(&mut unstructured).unwrap_or_default()
5619 }
5620}
5621impl Default for AUTH_KEY_DATA {
5622 fn default() -> Self {
5623 Self::DEFAULT.clone()
5624 }
5625}
5626impl MessageData for AUTH_KEY_DATA {
5627 type Message = MavMessage;
5628 const ID: u32 = 7u32;
5629 const NAME: &'static str = "AUTH_KEY";
5630 const EXTRA_CRC: u8 = 119u8;
5631 const ENCODED_LEN: usize = 32usize;
5632 fn deser(
5633 _version: MavlinkVersion,
5634 __input: &[u8],
5635 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5636 let avail_len = __input.len();
5637 let mut payload_buf = [0; Self::ENCODED_LEN];
5638 let mut buf = if avail_len < Self::ENCODED_LEN {
5639 payload_buf[0..avail_len].copy_from_slice(__input);
5640 Bytes::new(&payload_buf)
5641 } else {
5642 Bytes::new(__input)
5643 };
5644 let mut __struct = Self::default();
5645 for v in &mut __struct.key {
5646 let val = buf.get_u8();
5647 *v = val;
5648 }
5649 Ok(__struct)
5650 }
5651 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5652 let mut __tmp = BytesMut::new(bytes);
5653 #[allow(clippy::absurd_extreme_comparisons)]
5654 #[allow(unused_comparisons)]
5655 if __tmp.remaining() < Self::ENCODED_LEN {
5656 panic!(
5657 "buffer is too small (need {} bytes, but got {})",
5658 Self::ENCODED_LEN,
5659 __tmp.remaining(),
5660 )
5661 }
5662 for val in &self.key {
5663 __tmp.put_u8(*val);
5664 }
5665 if matches!(version, MavlinkVersion::V2) {
5666 let len = __tmp.len();
5667 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5668 } else {
5669 __tmp.len()
5670 }
5671 }
5672}
5673#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
5674#[doc = ""]
5675#[doc = "ID: 286"]
5676#[derive(Debug, Clone, PartialEq)]
5677#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5678#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5679pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5680 #[doc = "Timestamp (time since system boot)."]
5681 pub time_boot_us: u64,
5682 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
5683 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5684 pub q: [f32; 4],
5685 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
5686 pub q_estimated_delay_us: u32,
5687 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
5688 pub vx: f32,
5689 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
5690 pub vy: f32,
5691 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
5692 pub vz: f32,
5693 #[doc = "Estimated delay of the speed data. 0 if unknown."]
5694 pub v_estimated_delay_us: u32,
5695 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
5696 pub feed_forward_angular_velocity_z: f32,
5697 #[doc = "Bitmap indicating which estimator outputs are valid."]
5698 pub estimator_status: EstimatorStatusFlags,
5699 #[doc = "System ID"]
5700 pub target_system: u8,
5701 #[doc = "Component ID"]
5702 pub target_component: u8,
5703 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
5704 pub landed_state: MavLandedState,
5705 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
5706 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5707 pub angular_velocity_z: f32,
5708}
5709impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5710 pub const ENCODED_LEN: usize = 57usize;
5711 pub const DEFAULT: Self = Self {
5712 time_boot_us: 0_u64,
5713 q: [0.0_f32; 4usize],
5714 q_estimated_delay_us: 0_u32,
5715 vx: 0.0_f32,
5716 vy: 0.0_f32,
5717 vz: 0.0_f32,
5718 v_estimated_delay_us: 0_u32,
5719 feed_forward_angular_velocity_z: 0.0_f32,
5720 estimator_status: EstimatorStatusFlags::DEFAULT,
5721 target_system: 0_u8,
5722 target_component: 0_u8,
5723 landed_state: MavLandedState::DEFAULT,
5724 angular_velocity_z: 0.0_f32,
5725 };
5726 #[cfg(feature = "arbitrary")]
5727 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5728 use arbitrary::{Arbitrary, Unstructured};
5729 let mut buf = [0u8; 1024];
5730 rng.fill_bytes(&mut buf);
5731 let mut unstructured = Unstructured::new(&buf);
5732 Self::arbitrary(&mut unstructured).unwrap_or_default()
5733 }
5734}
5735impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5736 fn default() -> Self {
5737 Self::DEFAULT.clone()
5738 }
5739}
5740impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5741 type Message = MavMessage;
5742 const ID: u32 = 286u32;
5743 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
5744 const EXTRA_CRC: u8 = 210u8;
5745 const ENCODED_LEN: usize = 57usize;
5746 fn deser(
5747 _version: MavlinkVersion,
5748 __input: &[u8],
5749 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5750 let avail_len = __input.len();
5751 let mut payload_buf = [0; Self::ENCODED_LEN];
5752 let mut buf = if avail_len < Self::ENCODED_LEN {
5753 payload_buf[0..avail_len].copy_from_slice(__input);
5754 Bytes::new(&payload_buf)
5755 } else {
5756 Bytes::new(__input)
5757 };
5758 let mut __struct = Self::default();
5759 __struct.time_boot_us = buf.get_u64_le();
5760 for v in &mut __struct.q {
5761 let val = buf.get_f32_le();
5762 *v = val;
5763 }
5764 __struct.q_estimated_delay_us = buf.get_u32_le();
5765 __struct.vx = buf.get_f32_le();
5766 __struct.vy = buf.get_f32_le();
5767 __struct.vz = buf.get_f32_le();
5768 __struct.v_estimated_delay_us = buf.get_u32_le();
5769 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
5770 let tmp = buf.get_u16_le();
5771 __struct.estimator_status = EstimatorStatusFlags::from_bits(
5772 tmp & EstimatorStatusFlags::all().bits(),
5773 )
5774 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5775 flag_type: "EstimatorStatusFlags",
5776 value: tmp as u32,
5777 })?;
5778 __struct.target_system = buf.get_u8();
5779 __struct.target_component = buf.get_u8();
5780 let tmp = buf.get_u8();
5781 __struct.landed_state =
5782 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5783 enum_type: "MavLandedState",
5784 value: tmp as u32,
5785 })?;
5786 __struct.angular_velocity_z = buf.get_f32_le();
5787 Ok(__struct)
5788 }
5789 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5790 let mut __tmp = BytesMut::new(bytes);
5791 #[allow(clippy::absurd_extreme_comparisons)]
5792 #[allow(unused_comparisons)]
5793 if __tmp.remaining() < Self::ENCODED_LEN {
5794 panic!(
5795 "buffer is too small (need {} bytes, but got {})",
5796 Self::ENCODED_LEN,
5797 __tmp.remaining(),
5798 )
5799 }
5800 __tmp.put_u64_le(self.time_boot_us);
5801 for val in &self.q {
5802 __tmp.put_f32_le(*val);
5803 }
5804 __tmp.put_u32_le(self.q_estimated_delay_us);
5805 __tmp.put_f32_le(self.vx);
5806 __tmp.put_f32_le(self.vy);
5807 __tmp.put_f32_le(self.vz);
5808 __tmp.put_u32_le(self.v_estimated_delay_us);
5809 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
5810 __tmp.put_u16_le(self.estimator_status.bits());
5811 __tmp.put_u8(self.target_system);
5812 __tmp.put_u8(self.target_component);
5813 __tmp.put_u8(self.landed_state as u8);
5814 if matches!(version, MavlinkVersion::V2) {
5815 __tmp.put_f32_le(self.angular_velocity_z);
5816 let len = __tmp.len();
5817 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5818 } else {
5819 __tmp.len()
5820 }
5821 }
5822}
5823#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
5824#[doc = ""]
5825#[doc = "ID: 148"]
5826#[derive(Debug, Clone, PartialEq)]
5827#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5828#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5829pub struct AUTOPILOT_VERSION_DATA {
5830 #[doc = "Bitmap of capabilities"]
5831 pub capabilities: MavProtocolCapability,
5832 #[doc = "UID if provided by hardware (see uid2)"]
5833 pub uid: u64,
5834 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
5835 pub flight_sw_version: u32,
5836 #[doc = "Middleware version number"]
5837 pub middleware_sw_version: u32,
5838 #[doc = "Operating system version number"]
5839 pub os_sw_version: u32,
5840 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
5841 pub board_version: u32,
5842 #[doc = "ID of the board vendor"]
5843 pub vendor_id: u16,
5844 #[doc = "ID of the product"]
5845 pub product_id: u16,
5846 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5847 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5848 pub flight_custom_version: [u8; 8],
5849 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5850 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5851 pub middleware_custom_version: [u8; 8],
5852 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5853 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5854 pub os_custom_version: [u8; 8],
5855 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
5856 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5857 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5858 pub uid2: [u8; 18],
5859}
5860impl AUTOPILOT_VERSION_DATA {
5861 pub const ENCODED_LEN: usize = 78usize;
5862 pub const DEFAULT: Self = Self {
5863 capabilities: MavProtocolCapability::DEFAULT,
5864 uid: 0_u64,
5865 flight_sw_version: 0_u32,
5866 middleware_sw_version: 0_u32,
5867 os_sw_version: 0_u32,
5868 board_version: 0_u32,
5869 vendor_id: 0_u16,
5870 product_id: 0_u16,
5871 flight_custom_version: [0_u8; 8usize],
5872 middleware_custom_version: [0_u8; 8usize],
5873 os_custom_version: [0_u8; 8usize],
5874 uid2: [0_u8; 18usize],
5875 };
5876 #[cfg(feature = "arbitrary")]
5877 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5878 use arbitrary::{Arbitrary, Unstructured};
5879 let mut buf = [0u8; 1024];
5880 rng.fill_bytes(&mut buf);
5881 let mut unstructured = Unstructured::new(&buf);
5882 Self::arbitrary(&mut unstructured).unwrap_or_default()
5883 }
5884}
5885impl Default for AUTOPILOT_VERSION_DATA {
5886 fn default() -> Self {
5887 Self::DEFAULT.clone()
5888 }
5889}
5890impl MessageData for AUTOPILOT_VERSION_DATA {
5891 type Message = MavMessage;
5892 const ID: u32 = 148u32;
5893 const NAME: &'static str = "AUTOPILOT_VERSION";
5894 const EXTRA_CRC: u8 = 178u8;
5895 const ENCODED_LEN: usize = 78usize;
5896 fn deser(
5897 _version: MavlinkVersion,
5898 __input: &[u8],
5899 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5900 let avail_len = __input.len();
5901 let mut payload_buf = [0; Self::ENCODED_LEN];
5902 let mut buf = if avail_len < Self::ENCODED_LEN {
5903 payload_buf[0..avail_len].copy_from_slice(__input);
5904 Bytes::new(&payload_buf)
5905 } else {
5906 Bytes::new(__input)
5907 };
5908 let mut __struct = Self::default();
5909 let tmp = buf.get_u64_le();
5910 __struct.capabilities = MavProtocolCapability::from_bits(
5911 tmp & MavProtocolCapability::all().bits(),
5912 )
5913 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5914 flag_type: "MavProtocolCapability",
5915 value: tmp as u32,
5916 })?;
5917 __struct.uid = buf.get_u64_le();
5918 __struct.flight_sw_version = buf.get_u32_le();
5919 __struct.middleware_sw_version = buf.get_u32_le();
5920 __struct.os_sw_version = buf.get_u32_le();
5921 __struct.board_version = buf.get_u32_le();
5922 __struct.vendor_id = buf.get_u16_le();
5923 __struct.product_id = buf.get_u16_le();
5924 for v in &mut __struct.flight_custom_version {
5925 let val = buf.get_u8();
5926 *v = val;
5927 }
5928 for v in &mut __struct.middleware_custom_version {
5929 let val = buf.get_u8();
5930 *v = val;
5931 }
5932 for v in &mut __struct.os_custom_version {
5933 let val = buf.get_u8();
5934 *v = val;
5935 }
5936 for v in &mut __struct.uid2 {
5937 let val = buf.get_u8();
5938 *v = val;
5939 }
5940 Ok(__struct)
5941 }
5942 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5943 let mut __tmp = BytesMut::new(bytes);
5944 #[allow(clippy::absurd_extreme_comparisons)]
5945 #[allow(unused_comparisons)]
5946 if __tmp.remaining() < Self::ENCODED_LEN {
5947 panic!(
5948 "buffer is too small (need {} bytes, but got {})",
5949 Self::ENCODED_LEN,
5950 __tmp.remaining(),
5951 )
5952 }
5953 __tmp.put_u64_le(self.capabilities.bits());
5954 __tmp.put_u64_le(self.uid);
5955 __tmp.put_u32_le(self.flight_sw_version);
5956 __tmp.put_u32_le(self.middleware_sw_version);
5957 __tmp.put_u32_le(self.os_sw_version);
5958 __tmp.put_u32_le(self.board_version);
5959 __tmp.put_u16_le(self.vendor_id);
5960 __tmp.put_u16_le(self.product_id);
5961 for val in &self.flight_custom_version {
5962 __tmp.put_u8(*val);
5963 }
5964 for val in &self.middleware_custom_version {
5965 __tmp.put_u8(*val);
5966 }
5967 for val in &self.os_custom_version {
5968 __tmp.put_u8(*val);
5969 }
5970 if matches!(version, MavlinkVersion::V2) {
5971 for val in &self.uid2 {
5972 __tmp.put_u8(*val);
5973 }
5974 let len = __tmp.len();
5975 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5976 } else {
5977 __tmp.len()
5978 }
5979 }
5980}
5981#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
5982#[doc = ""]
5983#[doc = "ID: 435"]
5984#[derive(Debug, Clone, PartialEq)]
5985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5986#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5987pub struct AVAILABLE_MODES_DATA {
5988 #[doc = "A bitfield for use for autopilot-specific flags"]
5989 pub custom_mode: u32,
5990 #[doc = "Mode properties."]
5991 pub properties: MavModeProperty,
5992 #[doc = "The total number of available modes for the current vehicle type."]
5993 pub number_modes: u8,
5994 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
5995 pub mode_index: u8,
5996 #[doc = "Standard mode."]
5997 pub standard_mode: MavStandardMode,
5998 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
5999 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6000 pub mode_name: [u8; 35],
6001}
6002impl AVAILABLE_MODES_DATA {
6003 pub const ENCODED_LEN: usize = 46usize;
6004 pub const DEFAULT: Self = Self {
6005 custom_mode: 0_u32,
6006 properties: MavModeProperty::DEFAULT,
6007 number_modes: 0_u8,
6008 mode_index: 0_u8,
6009 standard_mode: MavStandardMode::DEFAULT,
6010 mode_name: [0_u8; 35usize],
6011 };
6012 #[cfg(feature = "arbitrary")]
6013 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6014 use arbitrary::{Arbitrary, Unstructured};
6015 let mut buf = [0u8; 1024];
6016 rng.fill_bytes(&mut buf);
6017 let mut unstructured = Unstructured::new(&buf);
6018 Self::arbitrary(&mut unstructured).unwrap_or_default()
6019 }
6020}
6021impl Default for AVAILABLE_MODES_DATA {
6022 fn default() -> Self {
6023 Self::DEFAULT.clone()
6024 }
6025}
6026impl MessageData for AVAILABLE_MODES_DATA {
6027 type Message = MavMessage;
6028 const ID: u32 = 435u32;
6029 const NAME: &'static str = "AVAILABLE_MODES";
6030 const EXTRA_CRC: u8 = 134u8;
6031 const ENCODED_LEN: usize = 46usize;
6032 fn deser(
6033 _version: MavlinkVersion,
6034 __input: &[u8],
6035 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6036 let avail_len = __input.len();
6037 let mut payload_buf = [0; Self::ENCODED_LEN];
6038 let mut buf = if avail_len < Self::ENCODED_LEN {
6039 payload_buf[0..avail_len].copy_from_slice(__input);
6040 Bytes::new(&payload_buf)
6041 } else {
6042 Bytes::new(__input)
6043 };
6044 let mut __struct = Self::default();
6045 __struct.custom_mode = buf.get_u32_le();
6046 let tmp = buf.get_u32_le();
6047 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6048 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6049 flag_type: "MavModeProperty",
6050 value: tmp as u32,
6051 })?;
6052 __struct.number_modes = buf.get_u8();
6053 __struct.mode_index = buf.get_u8();
6054 let tmp = buf.get_u8();
6055 __struct.standard_mode =
6056 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6057 enum_type: "MavStandardMode",
6058 value: tmp as u32,
6059 })?;
6060 for v in &mut __struct.mode_name {
6061 let val = buf.get_u8();
6062 *v = val;
6063 }
6064 Ok(__struct)
6065 }
6066 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6067 let mut __tmp = BytesMut::new(bytes);
6068 #[allow(clippy::absurd_extreme_comparisons)]
6069 #[allow(unused_comparisons)]
6070 if __tmp.remaining() < Self::ENCODED_LEN {
6071 panic!(
6072 "buffer is too small (need {} bytes, but got {})",
6073 Self::ENCODED_LEN,
6074 __tmp.remaining(),
6075 )
6076 }
6077 __tmp.put_u32_le(self.custom_mode);
6078 __tmp.put_u32_le(self.properties.bits());
6079 __tmp.put_u8(self.number_modes);
6080 __tmp.put_u8(self.mode_index);
6081 __tmp.put_u8(self.standard_mode as u8);
6082 for val in &self.mode_name {
6083 __tmp.put_u8(*val);
6084 }
6085 if matches!(version, MavlinkVersion::V2) {
6086 let len = __tmp.len();
6087 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6088 } else {
6089 __tmp.len()
6090 }
6091 }
6092}
6093#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6094#[doc = ""]
6095#[doc = "ID: 437"]
6096#[derive(Debug, Clone, PartialEq)]
6097#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6098#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6099pub struct AVAILABLE_MODES_MONITOR_DATA {
6100 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6101 pub seq: u8,
6102}
6103impl AVAILABLE_MODES_MONITOR_DATA {
6104 pub const ENCODED_LEN: usize = 1usize;
6105 pub const DEFAULT: Self = Self { seq: 0_u8 };
6106 #[cfg(feature = "arbitrary")]
6107 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6108 use arbitrary::{Arbitrary, Unstructured};
6109 let mut buf = [0u8; 1024];
6110 rng.fill_bytes(&mut buf);
6111 let mut unstructured = Unstructured::new(&buf);
6112 Self::arbitrary(&mut unstructured).unwrap_or_default()
6113 }
6114}
6115impl Default for AVAILABLE_MODES_MONITOR_DATA {
6116 fn default() -> Self {
6117 Self::DEFAULT.clone()
6118 }
6119}
6120impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6121 type Message = MavMessage;
6122 const ID: u32 = 437u32;
6123 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6124 const EXTRA_CRC: u8 = 30u8;
6125 const ENCODED_LEN: usize = 1usize;
6126 fn deser(
6127 _version: MavlinkVersion,
6128 __input: &[u8],
6129 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6130 let avail_len = __input.len();
6131 let mut payload_buf = [0; Self::ENCODED_LEN];
6132 let mut buf = if avail_len < Self::ENCODED_LEN {
6133 payload_buf[0..avail_len].copy_from_slice(__input);
6134 Bytes::new(&payload_buf)
6135 } else {
6136 Bytes::new(__input)
6137 };
6138 let mut __struct = Self::default();
6139 __struct.seq = buf.get_u8();
6140 Ok(__struct)
6141 }
6142 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6143 let mut __tmp = BytesMut::new(bytes);
6144 #[allow(clippy::absurd_extreme_comparisons)]
6145 #[allow(unused_comparisons)]
6146 if __tmp.remaining() < Self::ENCODED_LEN {
6147 panic!(
6148 "buffer is too small (need {} bytes, but got {})",
6149 Self::ENCODED_LEN,
6150 __tmp.remaining(),
6151 )
6152 }
6153 __tmp.put_u8(self.seq);
6154 if matches!(version, MavlinkVersion::V2) {
6155 let len = __tmp.len();
6156 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6157 } else {
6158 __tmp.len()
6159 }
6160 }
6161}
6162#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6163#[doc = ""]
6164#[doc = "ID: 372"]
6165#[derive(Debug, Clone, PartialEq)]
6166#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6168pub struct BATTERY_INFO_DATA {
6169 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6170 pub discharge_minimum_voltage: f32,
6171 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6172 pub charging_minimum_voltage: f32,
6173 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6174 pub resting_minimum_voltage: f32,
6175 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6176 pub charging_maximum_voltage: f32,
6177 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6178 pub charging_maximum_current: f32,
6179 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6180 pub nominal_voltage: f32,
6181 #[doc = "Maximum pack discharge current. 0: field not provided."]
6182 pub discharge_maximum_current: f32,
6183 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6184 pub discharge_maximum_burst_current: f32,
6185 #[doc = "Fully charged design capacity. 0: field not provided."]
6186 pub design_capacity: f32,
6187 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6188 pub full_charge_capacity: f32,
6189 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6190 pub cycle_count: u16,
6191 #[doc = "Battery weight. 0: field not provided."]
6192 pub weight: u16,
6193 #[doc = "Battery ID"]
6194 pub id: u8,
6195 #[doc = "Function of the battery."]
6196 pub battery_function: MavBatteryFunction,
6197 #[doc = "Type (chemistry) of the battery."]
6198 pub mavtype: MavBatteryType,
6199 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6200 pub state_of_health: u8,
6201 #[doc = "Number of battery cells in series. 0: field not provided."]
6202 pub cells_in_series: u8,
6203 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6204 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6205 pub manufacture_date: [u8; 9],
6206 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6207 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6208 pub serial_number: [u8; 32],
6209 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6210 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6211 pub name: [u8; 50],
6212}
6213impl BATTERY_INFO_DATA {
6214 pub const ENCODED_LEN: usize = 140usize;
6215 pub const DEFAULT: Self = Self {
6216 discharge_minimum_voltage: 0.0_f32,
6217 charging_minimum_voltage: 0.0_f32,
6218 resting_minimum_voltage: 0.0_f32,
6219 charging_maximum_voltage: 0.0_f32,
6220 charging_maximum_current: 0.0_f32,
6221 nominal_voltage: 0.0_f32,
6222 discharge_maximum_current: 0.0_f32,
6223 discharge_maximum_burst_current: 0.0_f32,
6224 design_capacity: 0.0_f32,
6225 full_charge_capacity: 0.0_f32,
6226 cycle_count: 0_u16,
6227 weight: 0_u16,
6228 id: 0_u8,
6229 battery_function: MavBatteryFunction::DEFAULT,
6230 mavtype: MavBatteryType::DEFAULT,
6231 state_of_health: 0_u8,
6232 cells_in_series: 0_u8,
6233 manufacture_date: [0_u8; 9usize],
6234 serial_number: [0_u8; 32usize],
6235 name: [0_u8; 50usize],
6236 };
6237 #[cfg(feature = "arbitrary")]
6238 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6239 use arbitrary::{Arbitrary, Unstructured};
6240 let mut buf = [0u8; 1024];
6241 rng.fill_bytes(&mut buf);
6242 let mut unstructured = Unstructured::new(&buf);
6243 Self::arbitrary(&mut unstructured).unwrap_or_default()
6244 }
6245}
6246impl Default for BATTERY_INFO_DATA {
6247 fn default() -> Self {
6248 Self::DEFAULT.clone()
6249 }
6250}
6251impl MessageData for BATTERY_INFO_DATA {
6252 type Message = MavMessage;
6253 const ID: u32 = 372u32;
6254 const NAME: &'static str = "BATTERY_INFO";
6255 const EXTRA_CRC: u8 = 26u8;
6256 const ENCODED_LEN: usize = 140usize;
6257 fn deser(
6258 _version: MavlinkVersion,
6259 __input: &[u8],
6260 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6261 let avail_len = __input.len();
6262 let mut payload_buf = [0; Self::ENCODED_LEN];
6263 let mut buf = if avail_len < Self::ENCODED_LEN {
6264 payload_buf[0..avail_len].copy_from_slice(__input);
6265 Bytes::new(&payload_buf)
6266 } else {
6267 Bytes::new(__input)
6268 };
6269 let mut __struct = Self::default();
6270 __struct.discharge_minimum_voltage = buf.get_f32_le();
6271 __struct.charging_minimum_voltage = buf.get_f32_le();
6272 __struct.resting_minimum_voltage = buf.get_f32_le();
6273 __struct.charging_maximum_voltage = buf.get_f32_le();
6274 __struct.charging_maximum_current = buf.get_f32_le();
6275 __struct.nominal_voltage = buf.get_f32_le();
6276 __struct.discharge_maximum_current = buf.get_f32_le();
6277 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6278 __struct.design_capacity = buf.get_f32_le();
6279 __struct.full_charge_capacity = buf.get_f32_le();
6280 __struct.cycle_count = buf.get_u16_le();
6281 __struct.weight = buf.get_u16_le();
6282 __struct.id = buf.get_u8();
6283 let tmp = buf.get_u8();
6284 __struct.battery_function =
6285 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6286 enum_type: "MavBatteryFunction",
6287 value: tmp as u32,
6288 })?;
6289 let tmp = buf.get_u8();
6290 __struct.mavtype =
6291 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6292 enum_type: "MavBatteryType",
6293 value: tmp as u32,
6294 })?;
6295 __struct.state_of_health = buf.get_u8();
6296 __struct.cells_in_series = buf.get_u8();
6297 for v in &mut __struct.manufacture_date {
6298 let val = buf.get_u8();
6299 *v = val;
6300 }
6301 for v in &mut __struct.serial_number {
6302 let val = buf.get_u8();
6303 *v = val;
6304 }
6305 for v in &mut __struct.name {
6306 let val = buf.get_u8();
6307 *v = val;
6308 }
6309 Ok(__struct)
6310 }
6311 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6312 let mut __tmp = BytesMut::new(bytes);
6313 #[allow(clippy::absurd_extreme_comparisons)]
6314 #[allow(unused_comparisons)]
6315 if __tmp.remaining() < Self::ENCODED_LEN {
6316 panic!(
6317 "buffer is too small (need {} bytes, but got {})",
6318 Self::ENCODED_LEN,
6319 __tmp.remaining(),
6320 )
6321 }
6322 __tmp.put_f32_le(self.discharge_minimum_voltage);
6323 __tmp.put_f32_le(self.charging_minimum_voltage);
6324 __tmp.put_f32_le(self.resting_minimum_voltage);
6325 __tmp.put_f32_le(self.charging_maximum_voltage);
6326 __tmp.put_f32_le(self.charging_maximum_current);
6327 __tmp.put_f32_le(self.nominal_voltage);
6328 __tmp.put_f32_le(self.discharge_maximum_current);
6329 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6330 __tmp.put_f32_le(self.design_capacity);
6331 __tmp.put_f32_le(self.full_charge_capacity);
6332 __tmp.put_u16_le(self.cycle_count);
6333 __tmp.put_u16_le(self.weight);
6334 __tmp.put_u8(self.id);
6335 __tmp.put_u8(self.battery_function as u8);
6336 __tmp.put_u8(self.mavtype as u8);
6337 __tmp.put_u8(self.state_of_health);
6338 __tmp.put_u8(self.cells_in_series);
6339 for val in &self.manufacture_date {
6340 __tmp.put_u8(*val);
6341 }
6342 for val in &self.serial_number {
6343 __tmp.put_u8(*val);
6344 }
6345 for val in &self.name {
6346 __tmp.put_u8(*val);
6347 }
6348 if matches!(version, MavlinkVersion::V2) {
6349 let len = __tmp.len();
6350 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6351 } else {
6352 __tmp.len()
6353 }
6354 }
6355}
6356#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6357#[doc = ""]
6358#[doc = "ID: 147"]
6359#[derive(Debug, Clone, PartialEq)]
6360#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6361#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6362pub struct BATTERY_STATUS_DATA {
6363 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6364 pub current_consumed: i32,
6365 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6366 pub energy_consumed: i32,
6367 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6368 pub temperature: i16,
6369 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6370 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6371 pub voltages: [u16; 10],
6372 #[doc = "Battery current, -1: autopilot does not measure the current"]
6373 pub current_battery: i16,
6374 #[doc = "Battery ID"]
6375 pub id: u8,
6376 #[doc = "Function of the battery"]
6377 pub battery_function: MavBatteryFunction,
6378 #[doc = "Type (chemistry) of the battery"]
6379 pub mavtype: MavBatteryType,
6380 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6381 pub battery_remaining: i8,
6382 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6383 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6384 pub time_remaining: i32,
6385 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6386 #[cfg_attr(feature = "serde", serde(default))]
6387 pub charge_state: MavBatteryChargeState,
6388 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6389 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6390 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6391 pub voltages_ext: [u16; 4],
6392 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6393 #[cfg_attr(feature = "serde", serde(default))]
6394 pub mode: MavBatteryMode,
6395 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6396 #[cfg_attr(feature = "serde", serde(default))]
6397 pub fault_bitmask: MavBatteryFault,
6398}
6399impl BATTERY_STATUS_DATA {
6400 pub const ENCODED_LEN: usize = 54usize;
6401 pub const DEFAULT: Self = Self {
6402 current_consumed: 0_i32,
6403 energy_consumed: 0_i32,
6404 temperature: 0_i16,
6405 voltages: [0_u16; 10usize],
6406 current_battery: 0_i16,
6407 id: 0_u8,
6408 battery_function: MavBatteryFunction::DEFAULT,
6409 mavtype: MavBatteryType::DEFAULT,
6410 battery_remaining: 0_i8,
6411 time_remaining: 0_i32,
6412 charge_state: MavBatteryChargeState::DEFAULT,
6413 voltages_ext: [0_u16; 4usize],
6414 mode: MavBatteryMode::DEFAULT,
6415 fault_bitmask: MavBatteryFault::DEFAULT,
6416 };
6417 #[cfg(feature = "arbitrary")]
6418 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6419 use arbitrary::{Arbitrary, Unstructured};
6420 let mut buf = [0u8; 1024];
6421 rng.fill_bytes(&mut buf);
6422 let mut unstructured = Unstructured::new(&buf);
6423 Self::arbitrary(&mut unstructured).unwrap_or_default()
6424 }
6425}
6426impl Default for BATTERY_STATUS_DATA {
6427 fn default() -> Self {
6428 Self::DEFAULT.clone()
6429 }
6430}
6431impl MessageData for BATTERY_STATUS_DATA {
6432 type Message = MavMessage;
6433 const ID: u32 = 147u32;
6434 const NAME: &'static str = "BATTERY_STATUS";
6435 const EXTRA_CRC: u8 = 154u8;
6436 const ENCODED_LEN: usize = 54usize;
6437 fn deser(
6438 _version: MavlinkVersion,
6439 __input: &[u8],
6440 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6441 let avail_len = __input.len();
6442 let mut payload_buf = [0; Self::ENCODED_LEN];
6443 let mut buf = if avail_len < Self::ENCODED_LEN {
6444 payload_buf[0..avail_len].copy_from_slice(__input);
6445 Bytes::new(&payload_buf)
6446 } else {
6447 Bytes::new(__input)
6448 };
6449 let mut __struct = Self::default();
6450 __struct.current_consumed = buf.get_i32_le();
6451 __struct.energy_consumed = buf.get_i32_le();
6452 __struct.temperature = buf.get_i16_le();
6453 for v in &mut __struct.voltages {
6454 let val = buf.get_u16_le();
6455 *v = val;
6456 }
6457 __struct.current_battery = buf.get_i16_le();
6458 __struct.id = buf.get_u8();
6459 let tmp = buf.get_u8();
6460 __struct.battery_function =
6461 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6462 enum_type: "MavBatteryFunction",
6463 value: tmp as u32,
6464 })?;
6465 let tmp = buf.get_u8();
6466 __struct.mavtype =
6467 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6468 enum_type: "MavBatteryType",
6469 value: tmp as u32,
6470 })?;
6471 __struct.battery_remaining = buf.get_i8();
6472 __struct.time_remaining = buf.get_i32_le();
6473 let tmp = buf.get_u8();
6474 __struct.charge_state =
6475 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6476 enum_type: "MavBatteryChargeState",
6477 value: tmp as u32,
6478 })?;
6479 for v in &mut __struct.voltages_ext {
6480 let val = buf.get_u16_le();
6481 *v = val;
6482 }
6483 let tmp = buf.get_u8();
6484 __struct.mode =
6485 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6486 enum_type: "MavBatteryMode",
6487 value: tmp as u32,
6488 })?;
6489 let tmp = buf.get_u32_le();
6490 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
6491 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6492 flag_type: "MavBatteryFault",
6493 value: tmp as u32,
6494 })?;
6495 Ok(__struct)
6496 }
6497 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6498 let mut __tmp = BytesMut::new(bytes);
6499 #[allow(clippy::absurd_extreme_comparisons)]
6500 #[allow(unused_comparisons)]
6501 if __tmp.remaining() < Self::ENCODED_LEN {
6502 panic!(
6503 "buffer is too small (need {} bytes, but got {})",
6504 Self::ENCODED_LEN,
6505 __tmp.remaining(),
6506 )
6507 }
6508 __tmp.put_i32_le(self.current_consumed);
6509 __tmp.put_i32_le(self.energy_consumed);
6510 __tmp.put_i16_le(self.temperature);
6511 for val in &self.voltages {
6512 __tmp.put_u16_le(*val);
6513 }
6514 __tmp.put_i16_le(self.current_battery);
6515 __tmp.put_u8(self.id);
6516 __tmp.put_u8(self.battery_function as u8);
6517 __tmp.put_u8(self.mavtype as u8);
6518 __tmp.put_i8(self.battery_remaining);
6519 if matches!(version, MavlinkVersion::V2) {
6520 __tmp.put_i32_le(self.time_remaining);
6521 __tmp.put_u8(self.charge_state as u8);
6522 for val in &self.voltages_ext {
6523 __tmp.put_u16_le(*val);
6524 }
6525 __tmp.put_u8(self.mode as u8);
6526 __tmp.put_u32_le(self.fault_bitmask.bits());
6527 let len = __tmp.len();
6528 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6529 } else {
6530 __tmp.len()
6531 }
6532 }
6533}
6534#[doc = "Report button state change."]
6535#[doc = ""]
6536#[doc = "ID: 257"]
6537#[derive(Debug, Clone, PartialEq)]
6538#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6539#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6540pub struct BUTTON_CHANGE_DATA {
6541 #[doc = "Timestamp (time since system boot)."]
6542 pub time_boot_ms: u32,
6543 #[doc = "Time of last change of button state."]
6544 pub last_change_ms: u32,
6545 #[doc = "Bitmap for state of buttons."]
6546 pub state: u8,
6547}
6548impl BUTTON_CHANGE_DATA {
6549 pub const ENCODED_LEN: usize = 9usize;
6550 pub const DEFAULT: Self = Self {
6551 time_boot_ms: 0_u32,
6552 last_change_ms: 0_u32,
6553 state: 0_u8,
6554 };
6555 #[cfg(feature = "arbitrary")]
6556 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6557 use arbitrary::{Arbitrary, Unstructured};
6558 let mut buf = [0u8; 1024];
6559 rng.fill_bytes(&mut buf);
6560 let mut unstructured = Unstructured::new(&buf);
6561 Self::arbitrary(&mut unstructured).unwrap_or_default()
6562 }
6563}
6564impl Default for BUTTON_CHANGE_DATA {
6565 fn default() -> Self {
6566 Self::DEFAULT.clone()
6567 }
6568}
6569impl MessageData for BUTTON_CHANGE_DATA {
6570 type Message = MavMessage;
6571 const ID: u32 = 257u32;
6572 const NAME: &'static str = "BUTTON_CHANGE";
6573 const EXTRA_CRC: u8 = 131u8;
6574 const ENCODED_LEN: usize = 9usize;
6575 fn deser(
6576 _version: MavlinkVersion,
6577 __input: &[u8],
6578 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6579 let avail_len = __input.len();
6580 let mut payload_buf = [0; Self::ENCODED_LEN];
6581 let mut buf = if avail_len < Self::ENCODED_LEN {
6582 payload_buf[0..avail_len].copy_from_slice(__input);
6583 Bytes::new(&payload_buf)
6584 } else {
6585 Bytes::new(__input)
6586 };
6587 let mut __struct = Self::default();
6588 __struct.time_boot_ms = buf.get_u32_le();
6589 __struct.last_change_ms = buf.get_u32_le();
6590 __struct.state = buf.get_u8();
6591 Ok(__struct)
6592 }
6593 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6594 let mut __tmp = BytesMut::new(bytes);
6595 #[allow(clippy::absurd_extreme_comparisons)]
6596 #[allow(unused_comparisons)]
6597 if __tmp.remaining() < Self::ENCODED_LEN {
6598 panic!(
6599 "buffer is too small (need {} bytes, but got {})",
6600 Self::ENCODED_LEN,
6601 __tmp.remaining(),
6602 )
6603 }
6604 __tmp.put_u32_le(self.time_boot_ms);
6605 __tmp.put_u32_le(self.last_change_ms);
6606 __tmp.put_u8(self.state);
6607 if matches!(version, MavlinkVersion::V2) {
6608 let len = __tmp.len();
6609 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6610 } else {
6611 __tmp.len()
6612 }
6613 }
6614}
6615#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6616#[doc = ""]
6617#[doc = "ID: 262"]
6618#[derive(Debug, Clone, PartialEq)]
6619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6620#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6621pub struct CAMERA_CAPTURE_STATUS_DATA {
6622 #[doc = "Timestamp (time since system boot)."]
6623 pub time_boot_ms: u32,
6624 #[doc = "Image capture interval"]
6625 pub image_interval: f32,
6626 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
6627 pub recording_time_ms: u32,
6628 #[doc = "Available storage capacity."]
6629 pub available_capacity: f32,
6630 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
6631 pub image_status: u8,
6632 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
6633 pub video_status: u8,
6634 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
6635 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6636 pub image_count: i32,
6637 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6638 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6639 pub camera_device_id: u8,
6640}
6641impl CAMERA_CAPTURE_STATUS_DATA {
6642 pub const ENCODED_LEN: usize = 23usize;
6643 pub const DEFAULT: Self = Self {
6644 time_boot_ms: 0_u32,
6645 image_interval: 0.0_f32,
6646 recording_time_ms: 0_u32,
6647 available_capacity: 0.0_f32,
6648 image_status: 0_u8,
6649 video_status: 0_u8,
6650 image_count: 0_i32,
6651 camera_device_id: 0_u8,
6652 };
6653 #[cfg(feature = "arbitrary")]
6654 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6655 use arbitrary::{Arbitrary, Unstructured};
6656 let mut buf = [0u8; 1024];
6657 rng.fill_bytes(&mut buf);
6658 let mut unstructured = Unstructured::new(&buf);
6659 Self::arbitrary(&mut unstructured).unwrap_or_default()
6660 }
6661}
6662impl Default for CAMERA_CAPTURE_STATUS_DATA {
6663 fn default() -> Self {
6664 Self::DEFAULT.clone()
6665 }
6666}
6667impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
6668 type Message = MavMessage;
6669 const ID: u32 = 262u32;
6670 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
6671 const EXTRA_CRC: u8 = 12u8;
6672 const ENCODED_LEN: usize = 23usize;
6673 fn deser(
6674 _version: MavlinkVersion,
6675 __input: &[u8],
6676 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6677 let avail_len = __input.len();
6678 let mut payload_buf = [0; Self::ENCODED_LEN];
6679 let mut buf = if avail_len < Self::ENCODED_LEN {
6680 payload_buf[0..avail_len].copy_from_slice(__input);
6681 Bytes::new(&payload_buf)
6682 } else {
6683 Bytes::new(__input)
6684 };
6685 let mut __struct = Self::default();
6686 __struct.time_boot_ms = buf.get_u32_le();
6687 __struct.image_interval = buf.get_f32_le();
6688 __struct.recording_time_ms = buf.get_u32_le();
6689 __struct.available_capacity = buf.get_f32_le();
6690 __struct.image_status = buf.get_u8();
6691 __struct.video_status = buf.get_u8();
6692 __struct.image_count = buf.get_i32_le();
6693 __struct.camera_device_id = buf.get_u8();
6694 Ok(__struct)
6695 }
6696 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6697 let mut __tmp = BytesMut::new(bytes);
6698 #[allow(clippy::absurd_extreme_comparisons)]
6699 #[allow(unused_comparisons)]
6700 if __tmp.remaining() < Self::ENCODED_LEN {
6701 panic!(
6702 "buffer is too small (need {} bytes, but got {})",
6703 Self::ENCODED_LEN,
6704 __tmp.remaining(),
6705 )
6706 }
6707 __tmp.put_u32_le(self.time_boot_ms);
6708 __tmp.put_f32_le(self.image_interval);
6709 __tmp.put_u32_le(self.recording_time_ms);
6710 __tmp.put_f32_le(self.available_capacity);
6711 __tmp.put_u8(self.image_status);
6712 __tmp.put_u8(self.video_status);
6713 if matches!(version, MavlinkVersion::V2) {
6714 __tmp.put_i32_le(self.image_count);
6715 __tmp.put_u8(self.camera_device_id);
6716 let len = __tmp.len();
6717 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6718 } else {
6719 __tmp.len()
6720 }
6721 }
6722}
6723#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6724#[doc = ""]
6725#[doc = "ID: 271"]
6726#[derive(Debug, Clone, PartialEq)]
6727#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6728#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6729pub struct CAMERA_FOV_STATUS_DATA {
6730 #[doc = "Timestamp (time since system boot)."]
6731 pub time_boot_ms: u32,
6732 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
6733 pub lat_camera: i32,
6734 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
6735 pub lon_camera: i32,
6736 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
6737 pub alt_camera: i32,
6738 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6739 pub lat_image: i32,
6740 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6741 pub lon_image: i32,
6742 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6743 pub alt_image: i32,
6744 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6745 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6746 pub q: [f32; 4],
6747 #[doc = "Horizontal field of view (NaN if unknown)."]
6748 pub hfov: f32,
6749 #[doc = "Vertical field of view (NaN if unknown)."]
6750 pub vfov: f32,
6751 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6752 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6753 pub camera_device_id: u8,
6754}
6755impl CAMERA_FOV_STATUS_DATA {
6756 pub const ENCODED_LEN: usize = 53usize;
6757 pub const DEFAULT: Self = Self {
6758 time_boot_ms: 0_u32,
6759 lat_camera: 0_i32,
6760 lon_camera: 0_i32,
6761 alt_camera: 0_i32,
6762 lat_image: 0_i32,
6763 lon_image: 0_i32,
6764 alt_image: 0_i32,
6765 q: [0.0_f32; 4usize],
6766 hfov: 0.0_f32,
6767 vfov: 0.0_f32,
6768 camera_device_id: 0_u8,
6769 };
6770 #[cfg(feature = "arbitrary")]
6771 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6772 use arbitrary::{Arbitrary, Unstructured};
6773 let mut buf = [0u8; 1024];
6774 rng.fill_bytes(&mut buf);
6775 let mut unstructured = Unstructured::new(&buf);
6776 Self::arbitrary(&mut unstructured).unwrap_or_default()
6777 }
6778}
6779impl Default for CAMERA_FOV_STATUS_DATA {
6780 fn default() -> Self {
6781 Self::DEFAULT.clone()
6782 }
6783}
6784impl MessageData for CAMERA_FOV_STATUS_DATA {
6785 type Message = MavMessage;
6786 const ID: u32 = 271u32;
6787 const NAME: &'static str = "CAMERA_FOV_STATUS";
6788 const EXTRA_CRC: u8 = 22u8;
6789 const ENCODED_LEN: usize = 53usize;
6790 fn deser(
6791 _version: MavlinkVersion,
6792 __input: &[u8],
6793 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6794 let avail_len = __input.len();
6795 let mut payload_buf = [0; Self::ENCODED_LEN];
6796 let mut buf = if avail_len < Self::ENCODED_LEN {
6797 payload_buf[0..avail_len].copy_from_slice(__input);
6798 Bytes::new(&payload_buf)
6799 } else {
6800 Bytes::new(__input)
6801 };
6802 let mut __struct = Self::default();
6803 __struct.time_boot_ms = buf.get_u32_le();
6804 __struct.lat_camera = buf.get_i32_le();
6805 __struct.lon_camera = buf.get_i32_le();
6806 __struct.alt_camera = buf.get_i32_le();
6807 __struct.lat_image = buf.get_i32_le();
6808 __struct.lon_image = buf.get_i32_le();
6809 __struct.alt_image = buf.get_i32_le();
6810 for v in &mut __struct.q {
6811 let val = buf.get_f32_le();
6812 *v = val;
6813 }
6814 __struct.hfov = buf.get_f32_le();
6815 __struct.vfov = buf.get_f32_le();
6816 __struct.camera_device_id = buf.get_u8();
6817 Ok(__struct)
6818 }
6819 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6820 let mut __tmp = BytesMut::new(bytes);
6821 #[allow(clippy::absurd_extreme_comparisons)]
6822 #[allow(unused_comparisons)]
6823 if __tmp.remaining() < Self::ENCODED_LEN {
6824 panic!(
6825 "buffer is too small (need {} bytes, but got {})",
6826 Self::ENCODED_LEN,
6827 __tmp.remaining(),
6828 )
6829 }
6830 __tmp.put_u32_le(self.time_boot_ms);
6831 __tmp.put_i32_le(self.lat_camera);
6832 __tmp.put_i32_le(self.lon_camera);
6833 __tmp.put_i32_le(self.alt_camera);
6834 __tmp.put_i32_le(self.lat_image);
6835 __tmp.put_i32_le(self.lon_image);
6836 __tmp.put_i32_le(self.alt_image);
6837 for val in &self.q {
6838 __tmp.put_f32_le(*val);
6839 }
6840 __tmp.put_f32_le(self.hfov);
6841 __tmp.put_f32_le(self.vfov);
6842 if matches!(version, MavlinkVersion::V2) {
6843 __tmp.put_u8(self.camera_device_id);
6844 let len = __tmp.len();
6845 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6846 } else {
6847 __tmp.len()
6848 }
6849 }
6850}
6851#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
6852#[doc = ""]
6853#[doc = "ID: 263"]
6854#[derive(Debug, Clone, PartialEq)]
6855#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6856#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6857pub struct CAMERA_IMAGE_CAPTURED_DATA {
6858 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
6859 pub time_utc: u64,
6860 #[doc = "Timestamp (time since system boot)."]
6861 pub time_boot_ms: u32,
6862 #[doc = "Latitude where image was taken"]
6863 pub lat: i32,
6864 #[doc = "Longitude where capture was taken"]
6865 pub lon: i32,
6866 #[doc = "Altitude (MSL) where image was taken"]
6867 pub alt: i32,
6868 #[doc = "Altitude above ground"]
6869 pub relative_alt: i32,
6870 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6871 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6872 pub q: [f32; 4],
6873 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
6874 pub image_index: i32,
6875 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
6876 pub camera_id: u8,
6877 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
6878 pub capture_result: i8,
6879 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
6880 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6881 pub file_url: [u8; 205],
6882}
6883impl CAMERA_IMAGE_CAPTURED_DATA {
6884 pub const ENCODED_LEN: usize = 255usize;
6885 pub const DEFAULT: Self = Self {
6886 time_utc: 0_u64,
6887 time_boot_ms: 0_u32,
6888 lat: 0_i32,
6889 lon: 0_i32,
6890 alt: 0_i32,
6891 relative_alt: 0_i32,
6892 q: [0.0_f32; 4usize],
6893 image_index: 0_i32,
6894 camera_id: 0_u8,
6895 capture_result: 0_i8,
6896 file_url: [0_u8; 205usize],
6897 };
6898 #[cfg(feature = "arbitrary")]
6899 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6900 use arbitrary::{Arbitrary, Unstructured};
6901 let mut buf = [0u8; 1024];
6902 rng.fill_bytes(&mut buf);
6903 let mut unstructured = Unstructured::new(&buf);
6904 Self::arbitrary(&mut unstructured).unwrap_or_default()
6905 }
6906}
6907impl Default for CAMERA_IMAGE_CAPTURED_DATA {
6908 fn default() -> Self {
6909 Self::DEFAULT.clone()
6910 }
6911}
6912impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
6913 type Message = MavMessage;
6914 const ID: u32 = 263u32;
6915 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
6916 const EXTRA_CRC: u8 = 133u8;
6917 const ENCODED_LEN: usize = 255usize;
6918 fn deser(
6919 _version: MavlinkVersion,
6920 __input: &[u8],
6921 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6922 let avail_len = __input.len();
6923 let mut payload_buf = [0; Self::ENCODED_LEN];
6924 let mut buf = if avail_len < Self::ENCODED_LEN {
6925 payload_buf[0..avail_len].copy_from_slice(__input);
6926 Bytes::new(&payload_buf)
6927 } else {
6928 Bytes::new(__input)
6929 };
6930 let mut __struct = Self::default();
6931 __struct.time_utc = buf.get_u64_le();
6932 __struct.time_boot_ms = buf.get_u32_le();
6933 __struct.lat = buf.get_i32_le();
6934 __struct.lon = buf.get_i32_le();
6935 __struct.alt = buf.get_i32_le();
6936 __struct.relative_alt = buf.get_i32_le();
6937 for v in &mut __struct.q {
6938 let val = buf.get_f32_le();
6939 *v = val;
6940 }
6941 __struct.image_index = buf.get_i32_le();
6942 __struct.camera_id = buf.get_u8();
6943 __struct.capture_result = buf.get_i8();
6944 for v in &mut __struct.file_url {
6945 let val = buf.get_u8();
6946 *v = val;
6947 }
6948 Ok(__struct)
6949 }
6950 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6951 let mut __tmp = BytesMut::new(bytes);
6952 #[allow(clippy::absurd_extreme_comparisons)]
6953 #[allow(unused_comparisons)]
6954 if __tmp.remaining() < Self::ENCODED_LEN {
6955 panic!(
6956 "buffer is too small (need {} bytes, but got {})",
6957 Self::ENCODED_LEN,
6958 __tmp.remaining(),
6959 )
6960 }
6961 __tmp.put_u64_le(self.time_utc);
6962 __tmp.put_u32_le(self.time_boot_ms);
6963 __tmp.put_i32_le(self.lat);
6964 __tmp.put_i32_le(self.lon);
6965 __tmp.put_i32_le(self.alt);
6966 __tmp.put_i32_le(self.relative_alt);
6967 for val in &self.q {
6968 __tmp.put_f32_le(*val);
6969 }
6970 __tmp.put_i32_le(self.image_index);
6971 __tmp.put_u8(self.camera_id);
6972 __tmp.put_i8(self.capture_result);
6973 for val in &self.file_url {
6974 __tmp.put_u8(*val);
6975 }
6976 if matches!(version, MavlinkVersion::V2) {
6977 let len = __tmp.len();
6978 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6979 } else {
6980 __tmp.len()
6981 }
6982 }
6983}
6984#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6985#[doc = ""]
6986#[doc = "ID: 259"]
6987#[derive(Debug, Clone, PartialEq)]
6988#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6989#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6990pub struct CAMERA_INFORMATION_DATA {
6991 #[doc = "Timestamp (time since system boot)."]
6992 pub time_boot_ms: u32,
6993 #[doc = "0xff). Use 0 if not known."]
6994 pub firmware_version: u32,
6995 #[doc = "Focal length. Use NaN if not known."]
6996 pub focal_length: f32,
6997 #[doc = "Image sensor size horizontal. Use NaN if not known."]
6998 pub sensor_size_h: f32,
6999 #[doc = "Image sensor size vertical. Use NaN if not known."]
7000 pub sensor_size_v: f32,
7001 #[doc = "Bitmap of camera capability flags."]
7002 pub flags: CameraCapFlags,
7003 #[doc = "Horizontal image resolution. Use 0 if not known."]
7004 pub resolution_h: u16,
7005 #[doc = "Vertical image resolution. Use 0 if not known."]
7006 pub resolution_v: u16,
7007 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7008 pub cam_definition_version: u16,
7009 #[doc = "Name of the camera vendor"]
7010 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7011 pub vendor_name: [u8; 32],
7012 #[doc = "Name of the camera model"]
7013 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7014 pub model_name: [u8; 32],
7015 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7016 pub lens_id: u8,
7017 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7018 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7019 pub cam_definition_uri: [u8; 140],
7020 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7021 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7022 pub gimbal_device_id: u8,
7023 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7024 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7025 pub camera_device_id: u8,
7026}
7027impl CAMERA_INFORMATION_DATA {
7028 pub const ENCODED_LEN: usize = 237usize;
7029 pub const DEFAULT: Self = Self {
7030 time_boot_ms: 0_u32,
7031 firmware_version: 0_u32,
7032 focal_length: 0.0_f32,
7033 sensor_size_h: 0.0_f32,
7034 sensor_size_v: 0.0_f32,
7035 flags: CameraCapFlags::DEFAULT,
7036 resolution_h: 0_u16,
7037 resolution_v: 0_u16,
7038 cam_definition_version: 0_u16,
7039 vendor_name: [0_u8; 32usize],
7040 model_name: [0_u8; 32usize],
7041 lens_id: 0_u8,
7042 cam_definition_uri: [0_u8; 140usize],
7043 gimbal_device_id: 0_u8,
7044 camera_device_id: 0_u8,
7045 };
7046 #[cfg(feature = "arbitrary")]
7047 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7048 use arbitrary::{Arbitrary, Unstructured};
7049 let mut buf = [0u8; 1024];
7050 rng.fill_bytes(&mut buf);
7051 let mut unstructured = Unstructured::new(&buf);
7052 Self::arbitrary(&mut unstructured).unwrap_or_default()
7053 }
7054}
7055impl Default for CAMERA_INFORMATION_DATA {
7056 fn default() -> Self {
7057 Self::DEFAULT.clone()
7058 }
7059}
7060impl MessageData for CAMERA_INFORMATION_DATA {
7061 type Message = MavMessage;
7062 const ID: u32 = 259u32;
7063 const NAME: &'static str = "CAMERA_INFORMATION";
7064 const EXTRA_CRC: u8 = 92u8;
7065 const ENCODED_LEN: usize = 237usize;
7066 fn deser(
7067 _version: MavlinkVersion,
7068 __input: &[u8],
7069 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7070 let avail_len = __input.len();
7071 let mut payload_buf = [0; Self::ENCODED_LEN];
7072 let mut buf = if avail_len < Self::ENCODED_LEN {
7073 payload_buf[0..avail_len].copy_from_slice(__input);
7074 Bytes::new(&payload_buf)
7075 } else {
7076 Bytes::new(__input)
7077 };
7078 let mut __struct = Self::default();
7079 __struct.time_boot_ms = buf.get_u32_le();
7080 __struct.firmware_version = buf.get_u32_le();
7081 __struct.focal_length = buf.get_f32_le();
7082 __struct.sensor_size_h = buf.get_f32_le();
7083 __struct.sensor_size_v = buf.get_f32_le();
7084 let tmp = buf.get_u32_le();
7085 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7086 ::mavlink_core::error::ParserError::InvalidFlag {
7087 flag_type: "CameraCapFlags",
7088 value: tmp as u32,
7089 },
7090 )?;
7091 __struct.resolution_h = buf.get_u16_le();
7092 __struct.resolution_v = buf.get_u16_le();
7093 __struct.cam_definition_version = buf.get_u16_le();
7094 for v in &mut __struct.vendor_name {
7095 let val = buf.get_u8();
7096 *v = val;
7097 }
7098 for v in &mut __struct.model_name {
7099 let val = buf.get_u8();
7100 *v = val;
7101 }
7102 __struct.lens_id = buf.get_u8();
7103 for v in &mut __struct.cam_definition_uri {
7104 let val = buf.get_u8();
7105 *v = val;
7106 }
7107 __struct.gimbal_device_id = buf.get_u8();
7108 __struct.camera_device_id = buf.get_u8();
7109 Ok(__struct)
7110 }
7111 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7112 let mut __tmp = BytesMut::new(bytes);
7113 #[allow(clippy::absurd_extreme_comparisons)]
7114 #[allow(unused_comparisons)]
7115 if __tmp.remaining() < Self::ENCODED_LEN {
7116 panic!(
7117 "buffer is too small (need {} bytes, but got {})",
7118 Self::ENCODED_LEN,
7119 __tmp.remaining(),
7120 )
7121 }
7122 __tmp.put_u32_le(self.time_boot_ms);
7123 __tmp.put_u32_le(self.firmware_version);
7124 __tmp.put_f32_le(self.focal_length);
7125 __tmp.put_f32_le(self.sensor_size_h);
7126 __tmp.put_f32_le(self.sensor_size_v);
7127 __tmp.put_u32_le(self.flags.bits());
7128 __tmp.put_u16_le(self.resolution_h);
7129 __tmp.put_u16_le(self.resolution_v);
7130 __tmp.put_u16_le(self.cam_definition_version);
7131 for val in &self.vendor_name {
7132 __tmp.put_u8(*val);
7133 }
7134 for val in &self.model_name {
7135 __tmp.put_u8(*val);
7136 }
7137 __tmp.put_u8(self.lens_id);
7138 for val in &self.cam_definition_uri {
7139 __tmp.put_u8(*val);
7140 }
7141 if matches!(version, MavlinkVersion::V2) {
7142 __tmp.put_u8(self.gimbal_device_id);
7143 __tmp.put_u8(self.camera_device_id);
7144 let len = __tmp.len();
7145 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7146 } else {
7147 __tmp.len()
7148 }
7149 }
7150}
7151#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7152#[doc = ""]
7153#[doc = "ID: 260"]
7154#[derive(Debug, Clone, PartialEq)]
7155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7157pub struct CAMERA_SETTINGS_DATA {
7158 #[doc = "Timestamp (time since system boot)."]
7159 pub time_boot_ms: u32,
7160 #[doc = "Camera mode"]
7161 pub mode_id: CameraMode,
7162 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7163 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7164 pub zoomLevel: f32,
7165 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7166 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7167 pub focusLevel: f32,
7168 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7169 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7170 pub camera_device_id: u8,
7171}
7172impl CAMERA_SETTINGS_DATA {
7173 pub const ENCODED_LEN: usize = 14usize;
7174 pub const DEFAULT: Self = Self {
7175 time_boot_ms: 0_u32,
7176 mode_id: CameraMode::DEFAULT,
7177 zoomLevel: 0.0_f32,
7178 focusLevel: 0.0_f32,
7179 camera_device_id: 0_u8,
7180 };
7181 #[cfg(feature = "arbitrary")]
7182 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7183 use arbitrary::{Arbitrary, Unstructured};
7184 let mut buf = [0u8; 1024];
7185 rng.fill_bytes(&mut buf);
7186 let mut unstructured = Unstructured::new(&buf);
7187 Self::arbitrary(&mut unstructured).unwrap_or_default()
7188 }
7189}
7190impl Default for CAMERA_SETTINGS_DATA {
7191 fn default() -> Self {
7192 Self::DEFAULT.clone()
7193 }
7194}
7195impl MessageData for CAMERA_SETTINGS_DATA {
7196 type Message = MavMessage;
7197 const ID: u32 = 260u32;
7198 const NAME: &'static str = "CAMERA_SETTINGS";
7199 const EXTRA_CRC: u8 = 146u8;
7200 const ENCODED_LEN: usize = 14usize;
7201 fn deser(
7202 _version: MavlinkVersion,
7203 __input: &[u8],
7204 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7205 let avail_len = __input.len();
7206 let mut payload_buf = [0; Self::ENCODED_LEN];
7207 let mut buf = if avail_len < Self::ENCODED_LEN {
7208 payload_buf[0..avail_len].copy_from_slice(__input);
7209 Bytes::new(&payload_buf)
7210 } else {
7211 Bytes::new(__input)
7212 };
7213 let mut __struct = Self::default();
7214 __struct.time_boot_ms = buf.get_u32_le();
7215 let tmp = buf.get_u8();
7216 __struct.mode_id =
7217 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7218 enum_type: "CameraMode",
7219 value: tmp as u32,
7220 })?;
7221 __struct.zoomLevel = buf.get_f32_le();
7222 __struct.focusLevel = buf.get_f32_le();
7223 __struct.camera_device_id = buf.get_u8();
7224 Ok(__struct)
7225 }
7226 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7227 let mut __tmp = BytesMut::new(bytes);
7228 #[allow(clippy::absurd_extreme_comparisons)]
7229 #[allow(unused_comparisons)]
7230 if __tmp.remaining() < Self::ENCODED_LEN {
7231 panic!(
7232 "buffer is too small (need {} bytes, but got {})",
7233 Self::ENCODED_LEN,
7234 __tmp.remaining(),
7235 )
7236 }
7237 __tmp.put_u32_le(self.time_boot_ms);
7238 __tmp.put_u8(self.mode_id as u8);
7239 if matches!(version, MavlinkVersion::V2) {
7240 __tmp.put_f32_le(self.zoomLevel);
7241 __tmp.put_f32_le(self.focusLevel);
7242 __tmp.put_u8(self.camera_device_id);
7243 let len = __tmp.len();
7244 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7245 } else {
7246 __tmp.len()
7247 }
7248 }
7249}
7250#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7251#[doc = ""]
7252#[doc = "ID: 277"]
7253#[derive(Debug, Clone, PartialEq)]
7254#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7256pub struct CAMERA_THERMAL_RANGE_DATA {
7257 #[doc = "Timestamp (time since system boot)."]
7258 pub time_boot_ms: u32,
7259 #[doc = "Temperature max."]
7260 pub max: f32,
7261 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7262 pub max_point_x: f32,
7263 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7264 pub max_point_y: f32,
7265 #[doc = "Temperature min."]
7266 pub min: f32,
7267 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7268 pub min_point_x: f32,
7269 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7270 pub min_point_y: f32,
7271 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7272 pub stream_id: u8,
7273 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7274 pub camera_device_id: u8,
7275}
7276impl CAMERA_THERMAL_RANGE_DATA {
7277 pub const ENCODED_LEN: usize = 30usize;
7278 pub const DEFAULT: Self = Self {
7279 time_boot_ms: 0_u32,
7280 max: 0.0_f32,
7281 max_point_x: 0.0_f32,
7282 max_point_y: 0.0_f32,
7283 min: 0.0_f32,
7284 min_point_x: 0.0_f32,
7285 min_point_y: 0.0_f32,
7286 stream_id: 0_u8,
7287 camera_device_id: 0_u8,
7288 };
7289 #[cfg(feature = "arbitrary")]
7290 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7291 use arbitrary::{Arbitrary, Unstructured};
7292 let mut buf = [0u8; 1024];
7293 rng.fill_bytes(&mut buf);
7294 let mut unstructured = Unstructured::new(&buf);
7295 Self::arbitrary(&mut unstructured).unwrap_or_default()
7296 }
7297}
7298impl Default for CAMERA_THERMAL_RANGE_DATA {
7299 fn default() -> Self {
7300 Self::DEFAULT.clone()
7301 }
7302}
7303impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7304 type Message = MavMessage;
7305 const ID: u32 = 277u32;
7306 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7307 const EXTRA_CRC: u8 = 62u8;
7308 const ENCODED_LEN: usize = 30usize;
7309 fn deser(
7310 _version: MavlinkVersion,
7311 __input: &[u8],
7312 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7313 let avail_len = __input.len();
7314 let mut payload_buf = [0; Self::ENCODED_LEN];
7315 let mut buf = if avail_len < Self::ENCODED_LEN {
7316 payload_buf[0..avail_len].copy_from_slice(__input);
7317 Bytes::new(&payload_buf)
7318 } else {
7319 Bytes::new(__input)
7320 };
7321 let mut __struct = Self::default();
7322 __struct.time_boot_ms = buf.get_u32_le();
7323 __struct.max = buf.get_f32_le();
7324 __struct.max_point_x = buf.get_f32_le();
7325 __struct.max_point_y = buf.get_f32_le();
7326 __struct.min = buf.get_f32_le();
7327 __struct.min_point_x = buf.get_f32_le();
7328 __struct.min_point_y = buf.get_f32_le();
7329 __struct.stream_id = buf.get_u8();
7330 __struct.camera_device_id = buf.get_u8();
7331 Ok(__struct)
7332 }
7333 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7334 let mut __tmp = BytesMut::new(bytes);
7335 #[allow(clippy::absurd_extreme_comparisons)]
7336 #[allow(unused_comparisons)]
7337 if __tmp.remaining() < Self::ENCODED_LEN {
7338 panic!(
7339 "buffer is too small (need {} bytes, but got {})",
7340 Self::ENCODED_LEN,
7341 __tmp.remaining(),
7342 )
7343 }
7344 __tmp.put_u32_le(self.time_boot_ms);
7345 __tmp.put_f32_le(self.max);
7346 __tmp.put_f32_le(self.max_point_x);
7347 __tmp.put_f32_le(self.max_point_y);
7348 __tmp.put_f32_le(self.min);
7349 __tmp.put_f32_le(self.min_point_x);
7350 __tmp.put_f32_le(self.min_point_y);
7351 __tmp.put_u8(self.stream_id);
7352 __tmp.put_u8(self.camera_device_id);
7353 if matches!(version, MavlinkVersion::V2) {
7354 let len = __tmp.len();
7355 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7356 } else {
7357 __tmp.len()
7358 }
7359 }
7360}
7361#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7362#[doc = ""]
7363#[doc = "ID: 276"]
7364#[derive(Debug, Clone, PartialEq)]
7365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7366#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7367pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7368 #[doc = "Latitude of tracked object"]
7369 pub lat: i32,
7370 #[doc = "Longitude of tracked object"]
7371 pub lon: i32,
7372 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7373 pub alt: f32,
7374 #[doc = "Horizontal accuracy. NAN if unknown"]
7375 pub h_acc: f32,
7376 #[doc = "Vertical accuracy. NAN if unknown"]
7377 pub v_acc: f32,
7378 #[doc = "North velocity of tracked object. NAN if unknown"]
7379 pub vel_n: f32,
7380 #[doc = "East velocity of tracked object. NAN if unknown"]
7381 pub vel_e: f32,
7382 #[doc = "Down velocity of tracked object. NAN if unknown"]
7383 pub vel_d: f32,
7384 #[doc = "Velocity accuracy. NAN if unknown"]
7385 pub vel_acc: f32,
7386 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7387 pub dist: f32,
7388 #[doc = "Heading in radians, in NED. NAN if unknown"]
7389 pub hdg: f32,
7390 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7391 pub hdg_acc: f32,
7392 #[doc = "Current tracking status"]
7393 pub tracking_status: CameraTrackingStatusFlags,
7394 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7395 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7396 pub camera_device_id: u8,
7397}
7398impl CAMERA_TRACKING_GEO_STATUS_DATA {
7399 pub const ENCODED_LEN: usize = 50usize;
7400 pub const DEFAULT: Self = Self {
7401 lat: 0_i32,
7402 lon: 0_i32,
7403 alt: 0.0_f32,
7404 h_acc: 0.0_f32,
7405 v_acc: 0.0_f32,
7406 vel_n: 0.0_f32,
7407 vel_e: 0.0_f32,
7408 vel_d: 0.0_f32,
7409 vel_acc: 0.0_f32,
7410 dist: 0.0_f32,
7411 hdg: 0.0_f32,
7412 hdg_acc: 0.0_f32,
7413 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7414 camera_device_id: 0_u8,
7415 };
7416 #[cfg(feature = "arbitrary")]
7417 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7418 use arbitrary::{Arbitrary, Unstructured};
7419 let mut buf = [0u8; 1024];
7420 rng.fill_bytes(&mut buf);
7421 let mut unstructured = Unstructured::new(&buf);
7422 Self::arbitrary(&mut unstructured).unwrap_or_default()
7423 }
7424}
7425impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7426 fn default() -> Self {
7427 Self::DEFAULT.clone()
7428 }
7429}
7430impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7431 type Message = MavMessage;
7432 const ID: u32 = 276u32;
7433 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7434 const EXTRA_CRC: u8 = 18u8;
7435 const ENCODED_LEN: usize = 50usize;
7436 fn deser(
7437 _version: MavlinkVersion,
7438 __input: &[u8],
7439 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7440 let avail_len = __input.len();
7441 let mut payload_buf = [0; Self::ENCODED_LEN];
7442 let mut buf = if avail_len < Self::ENCODED_LEN {
7443 payload_buf[0..avail_len].copy_from_slice(__input);
7444 Bytes::new(&payload_buf)
7445 } else {
7446 Bytes::new(__input)
7447 };
7448 let mut __struct = Self::default();
7449 __struct.lat = buf.get_i32_le();
7450 __struct.lon = buf.get_i32_le();
7451 __struct.alt = buf.get_f32_le();
7452 __struct.h_acc = buf.get_f32_le();
7453 __struct.v_acc = buf.get_f32_le();
7454 __struct.vel_n = buf.get_f32_le();
7455 __struct.vel_e = buf.get_f32_le();
7456 __struct.vel_d = buf.get_f32_le();
7457 __struct.vel_acc = buf.get_f32_le();
7458 __struct.dist = buf.get_f32_le();
7459 __struct.hdg = buf.get_f32_le();
7460 __struct.hdg_acc = buf.get_f32_le();
7461 let tmp = buf.get_u8();
7462 __struct.tracking_status =
7463 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7464 enum_type: "CameraTrackingStatusFlags",
7465 value: tmp as u32,
7466 })?;
7467 __struct.camera_device_id = buf.get_u8();
7468 Ok(__struct)
7469 }
7470 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7471 let mut __tmp = BytesMut::new(bytes);
7472 #[allow(clippy::absurd_extreme_comparisons)]
7473 #[allow(unused_comparisons)]
7474 if __tmp.remaining() < Self::ENCODED_LEN {
7475 panic!(
7476 "buffer is too small (need {} bytes, but got {})",
7477 Self::ENCODED_LEN,
7478 __tmp.remaining(),
7479 )
7480 }
7481 __tmp.put_i32_le(self.lat);
7482 __tmp.put_i32_le(self.lon);
7483 __tmp.put_f32_le(self.alt);
7484 __tmp.put_f32_le(self.h_acc);
7485 __tmp.put_f32_le(self.v_acc);
7486 __tmp.put_f32_le(self.vel_n);
7487 __tmp.put_f32_le(self.vel_e);
7488 __tmp.put_f32_le(self.vel_d);
7489 __tmp.put_f32_le(self.vel_acc);
7490 __tmp.put_f32_le(self.dist);
7491 __tmp.put_f32_le(self.hdg);
7492 __tmp.put_f32_le(self.hdg_acc);
7493 __tmp.put_u8(self.tracking_status as u8);
7494 if matches!(version, MavlinkVersion::V2) {
7495 __tmp.put_u8(self.camera_device_id);
7496 let len = __tmp.len();
7497 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7498 } else {
7499 __tmp.len()
7500 }
7501 }
7502}
7503#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7504#[doc = ""]
7505#[doc = "ID: 275"]
7506#[derive(Debug, Clone, PartialEq)]
7507#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7508#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7509pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
7510 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7511 pub point_x: f32,
7512 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7513 pub point_y: f32,
7514 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
7515 pub radius: f32,
7516 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7517 pub rec_top_x: f32,
7518 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7519 pub rec_top_y: f32,
7520 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7521 pub rec_bottom_x: f32,
7522 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7523 pub rec_bottom_y: f32,
7524 #[doc = "Current tracking status"]
7525 pub tracking_status: CameraTrackingStatusFlags,
7526 #[doc = "Current tracking mode"]
7527 pub tracking_mode: CameraTrackingMode,
7528 #[doc = "Defines location of target data"]
7529 pub target_data: CameraTrackingTargetData,
7530 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7531 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7532 pub camera_device_id: u8,
7533}
7534impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
7535 pub const ENCODED_LEN: usize = 32usize;
7536 pub const DEFAULT: Self = Self {
7537 point_x: 0.0_f32,
7538 point_y: 0.0_f32,
7539 radius: 0.0_f32,
7540 rec_top_x: 0.0_f32,
7541 rec_top_y: 0.0_f32,
7542 rec_bottom_x: 0.0_f32,
7543 rec_bottom_y: 0.0_f32,
7544 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7545 tracking_mode: CameraTrackingMode::DEFAULT,
7546 target_data: CameraTrackingTargetData::DEFAULT,
7547 camera_device_id: 0_u8,
7548 };
7549 #[cfg(feature = "arbitrary")]
7550 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7551 use arbitrary::{Arbitrary, Unstructured};
7552 let mut buf = [0u8; 1024];
7553 rng.fill_bytes(&mut buf);
7554 let mut unstructured = Unstructured::new(&buf);
7555 Self::arbitrary(&mut unstructured).unwrap_or_default()
7556 }
7557}
7558impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7559 fn default() -> Self {
7560 Self::DEFAULT.clone()
7561 }
7562}
7563impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7564 type Message = MavMessage;
7565 const ID: u32 = 275u32;
7566 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
7567 const EXTRA_CRC: u8 = 126u8;
7568 const ENCODED_LEN: usize = 32usize;
7569 fn deser(
7570 _version: MavlinkVersion,
7571 __input: &[u8],
7572 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7573 let avail_len = __input.len();
7574 let mut payload_buf = [0; Self::ENCODED_LEN];
7575 let mut buf = if avail_len < Self::ENCODED_LEN {
7576 payload_buf[0..avail_len].copy_from_slice(__input);
7577 Bytes::new(&payload_buf)
7578 } else {
7579 Bytes::new(__input)
7580 };
7581 let mut __struct = Self::default();
7582 __struct.point_x = buf.get_f32_le();
7583 __struct.point_y = buf.get_f32_le();
7584 __struct.radius = buf.get_f32_le();
7585 __struct.rec_top_x = buf.get_f32_le();
7586 __struct.rec_top_y = buf.get_f32_le();
7587 __struct.rec_bottom_x = buf.get_f32_le();
7588 __struct.rec_bottom_y = buf.get_f32_le();
7589 let tmp = buf.get_u8();
7590 __struct.tracking_status =
7591 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7592 enum_type: "CameraTrackingStatusFlags",
7593 value: tmp as u32,
7594 })?;
7595 let tmp = buf.get_u8();
7596 __struct.tracking_mode =
7597 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7598 enum_type: "CameraTrackingMode",
7599 value: tmp as u32,
7600 })?;
7601 let tmp = buf.get_u8();
7602 __struct.target_data =
7603 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
7604 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7605 flag_type: "CameraTrackingTargetData",
7606 value: tmp as u32,
7607 })?;
7608 __struct.camera_device_id = buf.get_u8();
7609 Ok(__struct)
7610 }
7611 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7612 let mut __tmp = BytesMut::new(bytes);
7613 #[allow(clippy::absurd_extreme_comparisons)]
7614 #[allow(unused_comparisons)]
7615 if __tmp.remaining() < Self::ENCODED_LEN {
7616 panic!(
7617 "buffer is too small (need {} bytes, but got {})",
7618 Self::ENCODED_LEN,
7619 __tmp.remaining(),
7620 )
7621 }
7622 __tmp.put_f32_le(self.point_x);
7623 __tmp.put_f32_le(self.point_y);
7624 __tmp.put_f32_le(self.radius);
7625 __tmp.put_f32_le(self.rec_top_x);
7626 __tmp.put_f32_le(self.rec_top_y);
7627 __tmp.put_f32_le(self.rec_bottom_x);
7628 __tmp.put_f32_le(self.rec_bottom_y);
7629 __tmp.put_u8(self.tracking_status as u8);
7630 __tmp.put_u8(self.tracking_mode as u8);
7631 __tmp.put_u8(self.target_data.bits());
7632 if matches!(version, MavlinkVersion::V2) {
7633 __tmp.put_u8(self.camera_device_id);
7634 let len = __tmp.len();
7635 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7636 } else {
7637 __tmp.len()
7638 }
7639 }
7640}
7641#[doc = "Camera-IMU triggering and synchronisation message."]
7642#[doc = ""]
7643#[doc = "ID: 112"]
7644#[derive(Debug, Clone, PartialEq)]
7645#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7646#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7647pub struct CAMERA_TRIGGER_DATA {
7648 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7649 pub time_usec: u64,
7650 #[doc = "Image frame sequence"]
7651 pub seq: u32,
7652}
7653impl CAMERA_TRIGGER_DATA {
7654 pub const ENCODED_LEN: usize = 12usize;
7655 pub const DEFAULT: Self = Self {
7656 time_usec: 0_u64,
7657 seq: 0_u32,
7658 };
7659 #[cfg(feature = "arbitrary")]
7660 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7661 use arbitrary::{Arbitrary, Unstructured};
7662 let mut buf = [0u8; 1024];
7663 rng.fill_bytes(&mut buf);
7664 let mut unstructured = Unstructured::new(&buf);
7665 Self::arbitrary(&mut unstructured).unwrap_or_default()
7666 }
7667}
7668impl Default for CAMERA_TRIGGER_DATA {
7669 fn default() -> Self {
7670 Self::DEFAULT.clone()
7671 }
7672}
7673impl MessageData for CAMERA_TRIGGER_DATA {
7674 type Message = MavMessage;
7675 const ID: u32 = 112u32;
7676 const NAME: &'static str = "CAMERA_TRIGGER";
7677 const EXTRA_CRC: u8 = 174u8;
7678 const ENCODED_LEN: usize = 12usize;
7679 fn deser(
7680 _version: MavlinkVersion,
7681 __input: &[u8],
7682 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7683 let avail_len = __input.len();
7684 let mut payload_buf = [0; Self::ENCODED_LEN];
7685 let mut buf = if avail_len < Self::ENCODED_LEN {
7686 payload_buf[0..avail_len].copy_from_slice(__input);
7687 Bytes::new(&payload_buf)
7688 } else {
7689 Bytes::new(__input)
7690 };
7691 let mut __struct = Self::default();
7692 __struct.time_usec = buf.get_u64_le();
7693 __struct.seq = buf.get_u32_le();
7694 Ok(__struct)
7695 }
7696 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7697 let mut __tmp = BytesMut::new(bytes);
7698 #[allow(clippy::absurd_extreme_comparisons)]
7699 #[allow(unused_comparisons)]
7700 if __tmp.remaining() < Self::ENCODED_LEN {
7701 panic!(
7702 "buffer is too small (need {} bytes, but got {})",
7703 Self::ENCODED_LEN,
7704 __tmp.remaining(),
7705 )
7706 }
7707 __tmp.put_u64_le(self.time_usec);
7708 __tmp.put_u32_le(self.seq);
7709 if matches!(version, MavlinkVersion::V2) {
7710 let len = __tmp.len();
7711 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7712 } else {
7713 __tmp.len()
7714 }
7715 }
7716}
7717#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
7718#[doc = ""]
7719#[doc = "ID: 387"]
7720#[derive(Debug, Clone, PartialEq)]
7721#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7722#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7723pub struct CANFD_FRAME_DATA {
7724 #[doc = "Frame ID"]
7725 pub id: u32,
7726 #[doc = "System ID."]
7727 pub target_system: u8,
7728 #[doc = "Component ID."]
7729 pub target_component: u8,
7730 #[doc = "bus number"]
7731 pub bus: u8,
7732 #[doc = "Frame length"]
7733 pub len: u8,
7734 #[doc = "Frame data"]
7735 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7736 pub data: [u8; 64],
7737}
7738impl CANFD_FRAME_DATA {
7739 pub const ENCODED_LEN: usize = 72usize;
7740 pub const DEFAULT: Self = Self {
7741 id: 0_u32,
7742 target_system: 0_u8,
7743 target_component: 0_u8,
7744 bus: 0_u8,
7745 len: 0_u8,
7746 data: [0_u8; 64usize],
7747 };
7748 #[cfg(feature = "arbitrary")]
7749 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7750 use arbitrary::{Arbitrary, Unstructured};
7751 let mut buf = [0u8; 1024];
7752 rng.fill_bytes(&mut buf);
7753 let mut unstructured = Unstructured::new(&buf);
7754 Self::arbitrary(&mut unstructured).unwrap_or_default()
7755 }
7756}
7757impl Default for CANFD_FRAME_DATA {
7758 fn default() -> Self {
7759 Self::DEFAULT.clone()
7760 }
7761}
7762impl MessageData for CANFD_FRAME_DATA {
7763 type Message = MavMessage;
7764 const ID: u32 = 387u32;
7765 const NAME: &'static str = "CANFD_FRAME";
7766 const EXTRA_CRC: u8 = 4u8;
7767 const ENCODED_LEN: usize = 72usize;
7768 fn deser(
7769 _version: MavlinkVersion,
7770 __input: &[u8],
7771 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7772 let avail_len = __input.len();
7773 let mut payload_buf = [0; Self::ENCODED_LEN];
7774 let mut buf = if avail_len < Self::ENCODED_LEN {
7775 payload_buf[0..avail_len].copy_from_slice(__input);
7776 Bytes::new(&payload_buf)
7777 } else {
7778 Bytes::new(__input)
7779 };
7780 let mut __struct = Self::default();
7781 __struct.id = buf.get_u32_le();
7782 __struct.target_system = buf.get_u8();
7783 __struct.target_component = buf.get_u8();
7784 __struct.bus = buf.get_u8();
7785 __struct.len = buf.get_u8();
7786 for v in &mut __struct.data {
7787 let val = buf.get_u8();
7788 *v = val;
7789 }
7790 Ok(__struct)
7791 }
7792 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7793 let mut __tmp = BytesMut::new(bytes);
7794 #[allow(clippy::absurd_extreme_comparisons)]
7795 #[allow(unused_comparisons)]
7796 if __tmp.remaining() < Self::ENCODED_LEN {
7797 panic!(
7798 "buffer is too small (need {} bytes, but got {})",
7799 Self::ENCODED_LEN,
7800 __tmp.remaining(),
7801 )
7802 }
7803 __tmp.put_u32_le(self.id);
7804 __tmp.put_u8(self.target_system);
7805 __tmp.put_u8(self.target_component);
7806 __tmp.put_u8(self.bus);
7807 __tmp.put_u8(self.len);
7808 for val in &self.data {
7809 __tmp.put_u8(*val);
7810 }
7811 if matches!(version, MavlinkVersion::V2) {
7812 let len = __tmp.len();
7813 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7814 } else {
7815 __tmp.len()
7816 }
7817 }
7818}
7819#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
7820#[doc = ""]
7821#[doc = "ID: 388"]
7822#[derive(Debug, Clone, PartialEq)]
7823#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7824#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7825pub struct CAN_FILTER_MODIFY_DATA {
7826 #[doc = "filter IDs, length num_ids"]
7827 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7828 pub ids: [u16; 16],
7829 #[doc = "System ID."]
7830 pub target_system: u8,
7831 #[doc = "Component ID."]
7832 pub target_component: u8,
7833 #[doc = "bus number"]
7834 pub bus: u8,
7835 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
7836 pub operation: CanFilterOp,
7837 #[doc = "number of IDs in filter list"]
7838 pub num_ids: u8,
7839}
7840impl CAN_FILTER_MODIFY_DATA {
7841 pub const ENCODED_LEN: usize = 37usize;
7842 pub const DEFAULT: Self = Self {
7843 ids: [0_u16; 16usize],
7844 target_system: 0_u8,
7845 target_component: 0_u8,
7846 bus: 0_u8,
7847 operation: CanFilterOp::DEFAULT,
7848 num_ids: 0_u8,
7849 };
7850 #[cfg(feature = "arbitrary")]
7851 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7852 use arbitrary::{Arbitrary, Unstructured};
7853 let mut buf = [0u8; 1024];
7854 rng.fill_bytes(&mut buf);
7855 let mut unstructured = Unstructured::new(&buf);
7856 Self::arbitrary(&mut unstructured).unwrap_or_default()
7857 }
7858}
7859impl Default for CAN_FILTER_MODIFY_DATA {
7860 fn default() -> Self {
7861 Self::DEFAULT.clone()
7862 }
7863}
7864impl MessageData for CAN_FILTER_MODIFY_DATA {
7865 type Message = MavMessage;
7866 const ID: u32 = 388u32;
7867 const NAME: &'static str = "CAN_FILTER_MODIFY";
7868 const EXTRA_CRC: u8 = 8u8;
7869 const ENCODED_LEN: usize = 37usize;
7870 fn deser(
7871 _version: MavlinkVersion,
7872 __input: &[u8],
7873 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7874 let avail_len = __input.len();
7875 let mut payload_buf = [0; Self::ENCODED_LEN];
7876 let mut buf = if avail_len < Self::ENCODED_LEN {
7877 payload_buf[0..avail_len].copy_from_slice(__input);
7878 Bytes::new(&payload_buf)
7879 } else {
7880 Bytes::new(__input)
7881 };
7882 let mut __struct = Self::default();
7883 for v in &mut __struct.ids {
7884 let val = buf.get_u16_le();
7885 *v = val;
7886 }
7887 __struct.target_system = buf.get_u8();
7888 __struct.target_component = buf.get_u8();
7889 __struct.bus = buf.get_u8();
7890 let tmp = buf.get_u8();
7891 __struct.operation =
7892 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7893 enum_type: "CanFilterOp",
7894 value: tmp as u32,
7895 })?;
7896 __struct.num_ids = buf.get_u8();
7897 Ok(__struct)
7898 }
7899 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7900 let mut __tmp = BytesMut::new(bytes);
7901 #[allow(clippy::absurd_extreme_comparisons)]
7902 #[allow(unused_comparisons)]
7903 if __tmp.remaining() < Self::ENCODED_LEN {
7904 panic!(
7905 "buffer is too small (need {} bytes, but got {})",
7906 Self::ENCODED_LEN,
7907 __tmp.remaining(),
7908 )
7909 }
7910 for val in &self.ids {
7911 __tmp.put_u16_le(*val);
7912 }
7913 __tmp.put_u8(self.target_system);
7914 __tmp.put_u8(self.target_component);
7915 __tmp.put_u8(self.bus);
7916 __tmp.put_u8(self.operation as u8);
7917 __tmp.put_u8(self.num_ids);
7918 if matches!(version, MavlinkVersion::V2) {
7919 let len = __tmp.len();
7920 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7921 } else {
7922 __tmp.len()
7923 }
7924 }
7925}
7926#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
7927#[doc = ""]
7928#[doc = "ID: 386"]
7929#[derive(Debug, Clone, PartialEq)]
7930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7931#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7932pub struct CAN_FRAME_DATA {
7933 #[doc = "Frame ID"]
7934 pub id: u32,
7935 #[doc = "System ID."]
7936 pub target_system: u8,
7937 #[doc = "Component ID."]
7938 pub target_component: u8,
7939 #[doc = "Bus number"]
7940 pub bus: u8,
7941 #[doc = "Frame length"]
7942 pub len: u8,
7943 #[doc = "Frame data"]
7944 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7945 pub data: [u8; 8],
7946}
7947impl CAN_FRAME_DATA {
7948 pub const ENCODED_LEN: usize = 16usize;
7949 pub const DEFAULT: Self = Self {
7950 id: 0_u32,
7951 target_system: 0_u8,
7952 target_component: 0_u8,
7953 bus: 0_u8,
7954 len: 0_u8,
7955 data: [0_u8; 8usize],
7956 };
7957 #[cfg(feature = "arbitrary")]
7958 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7959 use arbitrary::{Arbitrary, Unstructured};
7960 let mut buf = [0u8; 1024];
7961 rng.fill_bytes(&mut buf);
7962 let mut unstructured = Unstructured::new(&buf);
7963 Self::arbitrary(&mut unstructured).unwrap_or_default()
7964 }
7965}
7966impl Default for CAN_FRAME_DATA {
7967 fn default() -> Self {
7968 Self::DEFAULT.clone()
7969 }
7970}
7971impl MessageData for CAN_FRAME_DATA {
7972 type Message = MavMessage;
7973 const ID: u32 = 386u32;
7974 const NAME: &'static str = "CAN_FRAME";
7975 const EXTRA_CRC: u8 = 132u8;
7976 const ENCODED_LEN: usize = 16usize;
7977 fn deser(
7978 _version: MavlinkVersion,
7979 __input: &[u8],
7980 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7981 let avail_len = __input.len();
7982 let mut payload_buf = [0; Self::ENCODED_LEN];
7983 let mut buf = if avail_len < Self::ENCODED_LEN {
7984 payload_buf[0..avail_len].copy_from_slice(__input);
7985 Bytes::new(&payload_buf)
7986 } else {
7987 Bytes::new(__input)
7988 };
7989 let mut __struct = Self::default();
7990 __struct.id = buf.get_u32_le();
7991 __struct.target_system = buf.get_u8();
7992 __struct.target_component = buf.get_u8();
7993 __struct.bus = buf.get_u8();
7994 __struct.len = buf.get_u8();
7995 for v in &mut __struct.data {
7996 let val = buf.get_u8();
7997 *v = val;
7998 }
7999 Ok(__struct)
8000 }
8001 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8002 let mut __tmp = BytesMut::new(bytes);
8003 #[allow(clippy::absurd_extreme_comparisons)]
8004 #[allow(unused_comparisons)]
8005 if __tmp.remaining() < Self::ENCODED_LEN {
8006 panic!(
8007 "buffer is too small (need {} bytes, but got {})",
8008 Self::ENCODED_LEN,
8009 __tmp.remaining(),
8010 )
8011 }
8012 __tmp.put_u32_le(self.id);
8013 __tmp.put_u8(self.target_system);
8014 __tmp.put_u8(self.target_component);
8015 __tmp.put_u8(self.bus);
8016 __tmp.put_u8(self.len);
8017 for val in &self.data {
8018 __tmp.put_u8(*val);
8019 }
8020 if matches!(version, MavlinkVersion::V2) {
8021 let len = __tmp.len();
8022 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8023 } else {
8024 __tmp.len()
8025 }
8026 }
8027}
8028#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8029#[doc = ""]
8030#[doc = "ID: 336"]
8031#[derive(Debug, Clone, PartialEq)]
8032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8033#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8034pub struct CELLULAR_CONFIG_DATA {
8035 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8036 pub enable_lte: u8,
8037 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8038 pub enable_pin: u8,
8039 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8040 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8041 pub pin: [u8; 16],
8042 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8043 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8044 pub new_pin: [u8; 16],
8045 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8046 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8047 pub apn: [u8; 32],
8048 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8049 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8050 pub puk: [u8; 16],
8051 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8052 pub roaming: u8,
8053 #[doc = "Message acceptance response (sent back to GS)."]
8054 pub response: CellularConfigResponse,
8055}
8056impl CELLULAR_CONFIG_DATA {
8057 pub const ENCODED_LEN: usize = 84usize;
8058 pub const DEFAULT: Self = Self {
8059 enable_lte: 0_u8,
8060 enable_pin: 0_u8,
8061 pin: [0_u8; 16usize],
8062 new_pin: [0_u8; 16usize],
8063 apn: [0_u8; 32usize],
8064 puk: [0_u8; 16usize],
8065 roaming: 0_u8,
8066 response: CellularConfigResponse::DEFAULT,
8067 };
8068 #[cfg(feature = "arbitrary")]
8069 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8070 use arbitrary::{Arbitrary, Unstructured};
8071 let mut buf = [0u8; 1024];
8072 rng.fill_bytes(&mut buf);
8073 let mut unstructured = Unstructured::new(&buf);
8074 Self::arbitrary(&mut unstructured).unwrap_or_default()
8075 }
8076}
8077impl Default for CELLULAR_CONFIG_DATA {
8078 fn default() -> Self {
8079 Self::DEFAULT.clone()
8080 }
8081}
8082impl MessageData for CELLULAR_CONFIG_DATA {
8083 type Message = MavMessage;
8084 const ID: u32 = 336u32;
8085 const NAME: &'static str = "CELLULAR_CONFIG";
8086 const EXTRA_CRC: u8 = 245u8;
8087 const ENCODED_LEN: usize = 84usize;
8088 fn deser(
8089 _version: MavlinkVersion,
8090 __input: &[u8],
8091 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8092 let avail_len = __input.len();
8093 let mut payload_buf = [0; Self::ENCODED_LEN];
8094 let mut buf = if avail_len < Self::ENCODED_LEN {
8095 payload_buf[0..avail_len].copy_from_slice(__input);
8096 Bytes::new(&payload_buf)
8097 } else {
8098 Bytes::new(__input)
8099 };
8100 let mut __struct = Self::default();
8101 __struct.enable_lte = buf.get_u8();
8102 __struct.enable_pin = buf.get_u8();
8103 for v in &mut __struct.pin {
8104 let val = buf.get_u8();
8105 *v = val;
8106 }
8107 for v in &mut __struct.new_pin {
8108 let val = buf.get_u8();
8109 *v = val;
8110 }
8111 for v in &mut __struct.apn {
8112 let val = buf.get_u8();
8113 *v = val;
8114 }
8115 for v in &mut __struct.puk {
8116 let val = buf.get_u8();
8117 *v = val;
8118 }
8119 __struct.roaming = buf.get_u8();
8120 let tmp = buf.get_u8();
8121 __struct.response =
8122 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8123 enum_type: "CellularConfigResponse",
8124 value: tmp as u32,
8125 })?;
8126 Ok(__struct)
8127 }
8128 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8129 let mut __tmp = BytesMut::new(bytes);
8130 #[allow(clippy::absurd_extreme_comparisons)]
8131 #[allow(unused_comparisons)]
8132 if __tmp.remaining() < Self::ENCODED_LEN {
8133 panic!(
8134 "buffer is too small (need {} bytes, but got {})",
8135 Self::ENCODED_LEN,
8136 __tmp.remaining(),
8137 )
8138 }
8139 __tmp.put_u8(self.enable_lte);
8140 __tmp.put_u8(self.enable_pin);
8141 for val in &self.pin {
8142 __tmp.put_u8(*val);
8143 }
8144 for val in &self.new_pin {
8145 __tmp.put_u8(*val);
8146 }
8147 for val in &self.apn {
8148 __tmp.put_u8(*val);
8149 }
8150 for val in &self.puk {
8151 __tmp.put_u8(*val);
8152 }
8153 __tmp.put_u8(self.roaming);
8154 __tmp.put_u8(self.response as u8);
8155 if matches!(version, MavlinkVersion::V2) {
8156 let len = __tmp.len();
8157 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8158 } else {
8159 __tmp.len()
8160 }
8161 }
8162}
8163#[doc = "Report current used cellular network status."]
8164#[doc = ""]
8165#[doc = "ID: 334"]
8166#[derive(Debug, Clone, PartialEq)]
8167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8169pub struct CELLULAR_STATUS_DATA {
8170 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8171 pub mcc: u16,
8172 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8173 pub mnc: u16,
8174 #[doc = "Location area code. If unknown, set to 0"]
8175 pub lac: u16,
8176 #[doc = "Cellular modem status"]
8177 pub status: CellularStatusFlag,
8178 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8179 pub failure_reason: CellularNetworkFailedReason,
8180 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8181 pub mavtype: CellularNetworkRadioType,
8182 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8183 pub quality: u8,
8184}
8185impl CELLULAR_STATUS_DATA {
8186 pub const ENCODED_LEN: usize = 10usize;
8187 pub const DEFAULT: Self = Self {
8188 mcc: 0_u16,
8189 mnc: 0_u16,
8190 lac: 0_u16,
8191 status: CellularStatusFlag::DEFAULT,
8192 failure_reason: CellularNetworkFailedReason::DEFAULT,
8193 mavtype: CellularNetworkRadioType::DEFAULT,
8194 quality: 0_u8,
8195 };
8196 #[cfg(feature = "arbitrary")]
8197 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8198 use arbitrary::{Arbitrary, Unstructured};
8199 let mut buf = [0u8; 1024];
8200 rng.fill_bytes(&mut buf);
8201 let mut unstructured = Unstructured::new(&buf);
8202 Self::arbitrary(&mut unstructured).unwrap_or_default()
8203 }
8204}
8205impl Default for CELLULAR_STATUS_DATA {
8206 fn default() -> Self {
8207 Self::DEFAULT.clone()
8208 }
8209}
8210impl MessageData for CELLULAR_STATUS_DATA {
8211 type Message = MavMessage;
8212 const ID: u32 = 334u32;
8213 const NAME: &'static str = "CELLULAR_STATUS";
8214 const EXTRA_CRC: u8 = 72u8;
8215 const ENCODED_LEN: usize = 10usize;
8216 fn deser(
8217 _version: MavlinkVersion,
8218 __input: &[u8],
8219 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8220 let avail_len = __input.len();
8221 let mut payload_buf = [0; Self::ENCODED_LEN];
8222 let mut buf = if avail_len < Self::ENCODED_LEN {
8223 payload_buf[0..avail_len].copy_from_slice(__input);
8224 Bytes::new(&payload_buf)
8225 } else {
8226 Bytes::new(__input)
8227 };
8228 let mut __struct = Self::default();
8229 __struct.mcc = buf.get_u16_le();
8230 __struct.mnc = buf.get_u16_le();
8231 __struct.lac = buf.get_u16_le();
8232 let tmp = buf.get_u8();
8233 __struct.status =
8234 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8235 enum_type: "CellularStatusFlag",
8236 value: tmp as u32,
8237 })?;
8238 let tmp = buf.get_u8();
8239 __struct.failure_reason =
8240 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8241 enum_type: "CellularNetworkFailedReason",
8242 value: tmp as u32,
8243 })?;
8244 let tmp = buf.get_u8();
8245 __struct.mavtype =
8246 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8247 enum_type: "CellularNetworkRadioType",
8248 value: tmp as u32,
8249 })?;
8250 __struct.quality = buf.get_u8();
8251 Ok(__struct)
8252 }
8253 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8254 let mut __tmp = BytesMut::new(bytes);
8255 #[allow(clippy::absurd_extreme_comparisons)]
8256 #[allow(unused_comparisons)]
8257 if __tmp.remaining() < Self::ENCODED_LEN {
8258 panic!(
8259 "buffer is too small (need {} bytes, but got {})",
8260 Self::ENCODED_LEN,
8261 __tmp.remaining(),
8262 )
8263 }
8264 __tmp.put_u16_le(self.mcc);
8265 __tmp.put_u16_le(self.mnc);
8266 __tmp.put_u16_le(self.lac);
8267 __tmp.put_u8(self.status as u8);
8268 __tmp.put_u8(self.failure_reason as u8);
8269 __tmp.put_u8(self.mavtype as u8);
8270 __tmp.put_u8(self.quality);
8271 if matches!(version, MavlinkVersion::V2) {
8272 let len = __tmp.len();
8273 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8274 } else {
8275 __tmp.len()
8276 }
8277 }
8278}
8279#[doc = "Request to control this MAV."]
8280#[doc = ""]
8281#[doc = "ID: 5"]
8282#[derive(Debug, Clone, PartialEq)]
8283#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8284#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8285pub struct CHANGE_OPERATOR_CONTROL_DATA {
8286 #[doc = "System the GCS requests control for"]
8287 pub target_system: u8,
8288 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8289 pub control_request: u8,
8290 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8291 pub version: u8,
8292 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8293 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8294 pub passkey: [u8; 25],
8295}
8296impl CHANGE_OPERATOR_CONTROL_DATA {
8297 pub const ENCODED_LEN: usize = 28usize;
8298 pub const DEFAULT: Self = Self {
8299 target_system: 0_u8,
8300 control_request: 0_u8,
8301 version: 0_u8,
8302 passkey: [0_u8; 25usize],
8303 };
8304 #[cfg(feature = "arbitrary")]
8305 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8306 use arbitrary::{Arbitrary, Unstructured};
8307 let mut buf = [0u8; 1024];
8308 rng.fill_bytes(&mut buf);
8309 let mut unstructured = Unstructured::new(&buf);
8310 Self::arbitrary(&mut unstructured).unwrap_or_default()
8311 }
8312}
8313impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8314 fn default() -> Self {
8315 Self::DEFAULT.clone()
8316 }
8317}
8318impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8319 type Message = MavMessage;
8320 const ID: u32 = 5u32;
8321 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8322 const EXTRA_CRC: u8 = 217u8;
8323 const ENCODED_LEN: usize = 28usize;
8324 fn deser(
8325 _version: MavlinkVersion,
8326 __input: &[u8],
8327 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8328 let avail_len = __input.len();
8329 let mut payload_buf = [0; Self::ENCODED_LEN];
8330 let mut buf = if avail_len < Self::ENCODED_LEN {
8331 payload_buf[0..avail_len].copy_from_slice(__input);
8332 Bytes::new(&payload_buf)
8333 } else {
8334 Bytes::new(__input)
8335 };
8336 let mut __struct = Self::default();
8337 __struct.target_system = buf.get_u8();
8338 __struct.control_request = buf.get_u8();
8339 __struct.version = buf.get_u8();
8340 for v in &mut __struct.passkey {
8341 let val = buf.get_u8();
8342 *v = val;
8343 }
8344 Ok(__struct)
8345 }
8346 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8347 let mut __tmp = BytesMut::new(bytes);
8348 #[allow(clippy::absurd_extreme_comparisons)]
8349 #[allow(unused_comparisons)]
8350 if __tmp.remaining() < Self::ENCODED_LEN {
8351 panic!(
8352 "buffer is too small (need {} bytes, but got {})",
8353 Self::ENCODED_LEN,
8354 __tmp.remaining(),
8355 )
8356 }
8357 __tmp.put_u8(self.target_system);
8358 __tmp.put_u8(self.control_request);
8359 __tmp.put_u8(self.version);
8360 for val in &self.passkey {
8361 __tmp.put_u8(*val);
8362 }
8363 if matches!(version, MavlinkVersion::V2) {
8364 let len = __tmp.len();
8365 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8366 } else {
8367 __tmp.len()
8368 }
8369 }
8370}
8371#[doc = "Accept / deny control of this MAV."]
8372#[doc = ""]
8373#[doc = "ID: 6"]
8374#[derive(Debug, Clone, PartialEq)]
8375#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8376#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8377pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8378 #[doc = "ID of the GCS this message"]
8379 pub gcs_system_id: u8,
8380 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8381 pub control_request: u8,
8382 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8383 pub ack: u8,
8384}
8385impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8386 pub const ENCODED_LEN: usize = 3usize;
8387 pub const DEFAULT: Self = Self {
8388 gcs_system_id: 0_u8,
8389 control_request: 0_u8,
8390 ack: 0_u8,
8391 };
8392 #[cfg(feature = "arbitrary")]
8393 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8394 use arbitrary::{Arbitrary, Unstructured};
8395 let mut buf = [0u8; 1024];
8396 rng.fill_bytes(&mut buf);
8397 let mut unstructured = Unstructured::new(&buf);
8398 Self::arbitrary(&mut unstructured).unwrap_or_default()
8399 }
8400}
8401impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8402 fn default() -> Self {
8403 Self::DEFAULT.clone()
8404 }
8405}
8406impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8407 type Message = MavMessage;
8408 const ID: u32 = 6u32;
8409 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8410 const EXTRA_CRC: u8 = 104u8;
8411 const ENCODED_LEN: usize = 3usize;
8412 fn deser(
8413 _version: MavlinkVersion,
8414 __input: &[u8],
8415 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8416 let avail_len = __input.len();
8417 let mut payload_buf = [0; Self::ENCODED_LEN];
8418 let mut buf = if avail_len < Self::ENCODED_LEN {
8419 payload_buf[0..avail_len].copy_from_slice(__input);
8420 Bytes::new(&payload_buf)
8421 } else {
8422 Bytes::new(__input)
8423 };
8424 let mut __struct = Self::default();
8425 __struct.gcs_system_id = buf.get_u8();
8426 __struct.control_request = buf.get_u8();
8427 __struct.ack = buf.get_u8();
8428 Ok(__struct)
8429 }
8430 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8431 let mut __tmp = BytesMut::new(bytes);
8432 #[allow(clippy::absurd_extreme_comparisons)]
8433 #[allow(unused_comparisons)]
8434 if __tmp.remaining() < Self::ENCODED_LEN {
8435 panic!(
8436 "buffer is too small (need {} bytes, but got {})",
8437 Self::ENCODED_LEN,
8438 __tmp.remaining(),
8439 )
8440 }
8441 __tmp.put_u8(self.gcs_system_id);
8442 __tmp.put_u8(self.control_request);
8443 __tmp.put_u8(self.ack);
8444 if matches!(version, MavlinkVersion::V2) {
8445 let len = __tmp.len();
8446 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8447 } else {
8448 __tmp.len()
8449 }
8450 }
8451}
8452#[doc = "Information about a potential collision."]
8453#[doc = ""]
8454#[doc = "ID: 247"]
8455#[derive(Debug, Clone, PartialEq)]
8456#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8457#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8458pub struct COLLISION_DATA {
8459 #[doc = "Unique identifier, domain based on src field"]
8460 pub id: u32,
8461 #[doc = "Estimated time until collision occurs"]
8462 pub time_to_minimum_delta: f32,
8463 #[doc = "Closest vertical distance between vehicle and object"]
8464 pub altitude_minimum_delta: f32,
8465 #[doc = "Closest horizontal distance between vehicle and object"]
8466 pub horizontal_minimum_delta: f32,
8467 #[doc = "Collision data source"]
8468 pub src: MavCollisionSrc,
8469 #[doc = "Action that is being taken to avoid this collision"]
8470 pub action: MavCollisionAction,
8471 #[doc = "How concerned the aircraft is about this collision"]
8472 pub threat_level: MavCollisionThreatLevel,
8473}
8474impl COLLISION_DATA {
8475 pub const ENCODED_LEN: usize = 19usize;
8476 pub const DEFAULT: Self = Self {
8477 id: 0_u32,
8478 time_to_minimum_delta: 0.0_f32,
8479 altitude_minimum_delta: 0.0_f32,
8480 horizontal_minimum_delta: 0.0_f32,
8481 src: MavCollisionSrc::DEFAULT,
8482 action: MavCollisionAction::DEFAULT,
8483 threat_level: MavCollisionThreatLevel::DEFAULT,
8484 };
8485 #[cfg(feature = "arbitrary")]
8486 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8487 use arbitrary::{Arbitrary, Unstructured};
8488 let mut buf = [0u8; 1024];
8489 rng.fill_bytes(&mut buf);
8490 let mut unstructured = Unstructured::new(&buf);
8491 Self::arbitrary(&mut unstructured).unwrap_or_default()
8492 }
8493}
8494impl Default for COLLISION_DATA {
8495 fn default() -> Self {
8496 Self::DEFAULT.clone()
8497 }
8498}
8499impl MessageData for COLLISION_DATA {
8500 type Message = MavMessage;
8501 const ID: u32 = 247u32;
8502 const NAME: &'static str = "COLLISION";
8503 const EXTRA_CRC: u8 = 81u8;
8504 const ENCODED_LEN: usize = 19usize;
8505 fn deser(
8506 _version: MavlinkVersion,
8507 __input: &[u8],
8508 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8509 let avail_len = __input.len();
8510 let mut payload_buf = [0; Self::ENCODED_LEN];
8511 let mut buf = if avail_len < Self::ENCODED_LEN {
8512 payload_buf[0..avail_len].copy_from_slice(__input);
8513 Bytes::new(&payload_buf)
8514 } else {
8515 Bytes::new(__input)
8516 };
8517 let mut __struct = Self::default();
8518 __struct.id = buf.get_u32_le();
8519 __struct.time_to_minimum_delta = buf.get_f32_le();
8520 __struct.altitude_minimum_delta = buf.get_f32_le();
8521 __struct.horizontal_minimum_delta = buf.get_f32_le();
8522 let tmp = buf.get_u8();
8523 __struct.src =
8524 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8525 enum_type: "MavCollisionSrc",
8526 value: tmp as u32,
8527 })?;
8528 let tmp = buf.get_u8();
8529 __struct.action =
8530 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8531 enum_type: "MavCollisionAction",
8532 value: tmp as u32,
8533 })?;
8534 let tmp = buf.get_u8();
8535 __struct.threat_level =
8536 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8537 enum_type: "MavCollisionThreatLevel",
8538 value: tmp as u32,
8539 })?;
8540 Ok(__struct)
8541 }
8542 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8543 let mut __tmp = BytesMut::new(bytes);
8544 #[allow(clippy::absurd_extreme_comparisons)]
8545 #[allow(unused_comparisons)]
8546 if __tmp.remaining() < Self::ENCODED_LEN {
8547 panic!(
8548 "buffer is too small (need {} bytes, but got {})",
8549 Self::ENCODED_LEN,
8550 __tmp.remaining(),
8551 )
8552 }
8553 __tmp.put_u32_le(self.id);
8554 __tmp.put_f32_le(self.time_to_minimum_delta);
8555 __tmp.put_f32_le(self.altitude_minimum_delta);
8556 __tmp.put_f32_le(self.horizontal_minimum_delta);
8557 __tmp.put_u8(self.src as u8);
8558 __tmp.put_u8(self.action as u8);
8559 __tmp.put_u8(self.threat_level as u8);
8560 if matches!(version, MavlinkVersion::V2) {
8561 let len = __tmp.len();
8562 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8563 } else {
8564 __tmp.len()
8565 }
8566 }
8567}
8568#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8569#[doc = ""]
8570#[doc = "ID: 77"]
8571#[derive(Debug, Clone, PartialEq)]
8572#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8573#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8574pub struct COMMAND_ACK_DATA {
8575 #[doc = "Command ID (of acknowledged command)."]
8576 pub command: MavCmd,
8577 #[doc = "Result of command."]
8578 pub result: MavResult,
8579 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
8580 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8581 pub progress: u8,
8582 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
8583 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8584 pub result_param2: i32,
8585 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8586 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8587 pub target_system: u8,
8588 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8589 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8590 pub target_component: u8,
8591}
8592impl COMMAND_ACK_DATA {
8593 pub const ENCODED_LEN: usize = 10usize;
8594 pub const DEFAULT: Self = Self {
8595 command: MavCmd::DEFAULT,
8596 result: MavResult::DEFAULT,
8597 progress: 0_u8,
8598 result_param2: 0_i32,
8599 target_system: 0_u8,
8600 target_component: 0_u8,
8601 };
8602 #[cfg(feature = "arbitrary")]
8603 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8604 use arbitrary::{Arbitrary, Unstructured};
8605 let mut buf = [0u8; 1024];
8606 rng.fill_bytes(&mut buf);
8607 let mut unstructured = Unstructured::new(&buf);
8608 Self::arbitrary(&mut unstructured).unwrap_or_default()
8609 }
8610}
8611impl Default for COMMAND_ACK_DATA {
8612 fn default() -> Self {
8613 Self::DEFAULT.clone()
8614 }
8615}
8616impl MessageData for COMMAND_ACK_DATA {
8617 type Message = MavMessage;
8618 const ID: u32 = 77u32;
8619 const NAME: &'static str = "COMMAND_ACK";
8620 const EXTRA_CRC: u8 = 143u8;
8621 const ENCODED_LEN: usize = 10usize;
8622 fn deser(
8623 _version: MavlinkVersion,
8624 __input: &[u8],
8625 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8626 let avail_len = __input.len();
8627 let mut payload_buf = [0; Self::ENCODED_LEN];
8628 let mut buf = if avail_len < Self::ENCODED_LEN {
8629 payload_buf[0..avail_len].copy_from_slice(__input);
8630 Bytes::new(&payload_buf)
8631 } else {
8632 Bytes::new(__input)
8633 };
8634 let mut __struct = Self::default();
8635 let tmp = buf.get_u16_le();
8636 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8637 ::mavlink_core::error::ParserError::InvalidEnum {
8638 enum_type: "MavCmd",
8639 value: tmp as u32,
8640 },
8641 )?;
8642 let tmp = buf.get_u8();
8643 __struct.result =
8644 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8645 enum_type: "MavResult",
8646 value: tmp as u32,
8647 })?;
8648 __struct.progress = buf.get_u8();
8649 __struct.result_param2 = buf.get_i32_le();
8650 __struct.target_system = buf.get_u8();
8651 __struct.target_component = buf.get_u8();
8652 Ok(__struct)
8653 }
8654 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8655 let mut __tmp = BytesMut::new(bytes);
8656 #[allow(clippy::absurd_extreme_comparisons)]
8657 #[allow(unused_comparisons)]
8658 if __tmp.remaining() < Self::ENCODED_LEN {
8659 panic!(
8660 "buffer is too small (need {} bytes, but got {})",
8661 Self::ENCODED_LEN,
8662 __tmp.remaining(),
8663 )
8664 }
8665 __tmp.put_u16_le(self.command as u16);
8666 __tmp.put_u8(self.result as u8);
8667 if matches!(version, MavlinkVersion::V2) {
8668 __tmp.put_u8(self.progress);
8669 __tmp.put_i32_le(self.result_param2);
8670 __tmp.put_u8(self.target_system);
8671 __tmp.put_u8(self.target_component);
8672 let len = __tmp.len();
8673 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8674 } else {
8675 __tmp.len()
8676 }
8677 }
8678}
8679#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8680#[doc = ""]
8681#[doc = "ID: 80"]
8682#[derive(Debug, Clone, PartialEq)]
8683#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8684#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8685pub struct COMMAND_CANCEL_DATA {
8686 #[doc = "Command ID (of command to cancel)."]
8687 pub command: MavCmd,
8688 #[doc = "System executing long running command. Should not be broadcast (0)."]
8689 pub target_system: u8,
8690 #[doc = "Component executing long running command."]
8691 pub target_component: u8,
8692}
8693impl COMMAND_CANCEL_DATA {
8694 pub const ENCODED_LEN: usize = 4usize;
8695 pub const DEFAULT: Self = Self {
8696 command: MavCmd::DEFAULT,
8697 target_system: 0_u8,
8698 target_component: 0_u8,
8699 };
8700 #[cfg(feature = "arbitrary")]
8701 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8702 use arbitrary::{Arbitrary, Unstructured};
8703 let mut buf = [0u8; 1024];
8704 rng.fill_bytes(&mut buf);
8705 let mut unstructured = Unstructured::new(&buf);
8706 Self::arbitrary(&mut unstructured).unwrap_or_default()
8707 }
8708}
8709impl Default for COMMAND_CANCEL_DATA {
8710 fn default() -> Self {
8711 Self::DEFAULT.clone()
8712 }
8713}
8714impl MessageData for COMMAND_CANCEL_DATA {
8715 type Message = MavMessage;
8716 const ID: u32 = 80u32;
8717 const NAME: &'static str = "COMMAND_CANCEL";
8718 const EXTRA_CRC: u8 = 14u8;
8719 const ENCODED_LEN: usize = 4usize;
8720 fn deser(
8721 _version: MavlinkVersion,
8722 __input: &[u8],
8723 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8724 let avail_len = __input.len();
8725 let mut payload_buf = [0; Self::ENCODED_LEN];
8726 let mut buf = if avail_len < Self::ENCODED_LEN {
8727 payload_buf[0..avail_len].copy_from_slice(__input);
8728 Bytes::new(&payload_buf)
8729 } else {
8730 Bytes::new(__input)
8731 };
8732 let mut __struct = Self::default();
8733 let tmp = buf.get_u16_le();
8734 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8735 ::mavlink_core::error::ParserError::InvalidEnum {
8736 enum_type: "MavCmd",
8737 value: tmp as u32,
8738 },
8739 )?;
8740 __struct.target_system = buf.get_u8();
8741 __struct.target_component = buf.get_u8();
8742 Ok(__struct)
8743 }
8744 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8745 let mut __tmp = BytesMut::new(bytes);
8746 #[allow(clippy::absurd_extreme_comparisons)]
8747 #[allow(unused_comparisons)]
8748 if __tmp.remaining() < Self::ENCODED_LEN {
8749 panic!(
8750 "buffer is too small (need {} bytes, but got {})",
8751 Self::ENCODED_LEN,
8752 __tmp.remaining(),
8753 )
8754 }
8755 __tmp.put_u16_le(self.command as u16);
8756 __tmp.put_u8(self.target_system);
8757 __tmp.put_u8(self.target_component);
8758 if matches!(version, MavlinkVersion::V2) {
8759 let len = __tmp.len();
8760 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8761 } else {
8762 __tmp.len()
8763 }
8764 }
8765}
8766#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8767#[doc = ""]
8768#[doc = "ID: 75"]
8769#[derive(Debug, Clone, PartialEq)]
8770#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8771#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8772pub struct COMMAND_INT_DATA {
8773 #[doc = "PARAM1, see MAV_CMD enum"]
8774 pub param1: f32,
8775 #[doc = "PARAM2, see MAV_CMD enum"]
8776 pub param2: f32,
8777 #[doc = "PARAM3, see MAV_CMD enum"]
8778 pub param3: f32,
8779 #[doc = "PARAM4, see MAV_CMD enum"]
8780 pub param4: f32,
8781 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
8782 pub x: i32,
8783 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
8784 pub y: i32,
8785 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
8786 pub z: f32,
8787 #[doc = "The scheduled action for the mission item."]
8788 pub command: MavCmd,
8789 #[doc = "System ID"]
8790 pub target_system: u8,
8791 #[doc = "Component ID"]
8792 pub target_component: u8,
8793 #[doc = "The coordinate system of the COMMAND."]
8794 pub frame: MavFrame,
8795 #[doc = "Not used."]
8796 pub current: u8,
8797 #[doc = "Not used (set 0)."]
8798 pub autocontinue: u8,
8799}
8800impl COMMAND_INT_DATA {
8801 pub const ENCODED_LEN: usize = 35usize;
8802 pub const DEFAULT: Self = Self {
8803 param1: 0.0_f32,
8804 param2: 0.0_f32,
8805 param3: 0.0_f32,
8806 param4: 0.0_f32,
8807 x: 0_i32,
8808 y: 0_i32,
8809 z: 0.0_f32,
8810 command: MavCmd::DEFAULT,
8811 target_system: 0_u8,
8812 target_component: 0_u8,
8813 frame: MavFrame::DEFAULT,
8814 current: 0_u8,
8815 autocontinue: 0_u8,
8816 };
8817 #[cfg(feature = "arbitrary")]
8818 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8819 use arbitrary::{Arbitrary, Unstructured};
8820 let mut buf = [0u8; 1024];
8821 rng.fill_bytes(&mut buf);
8822 let mut unstructured = Unstructured::new(&buf);
8823 Self::arbitrary(&mut unstructured).unwrap_or_default()
8824 }
8825}
8826impl Default for COMMAND_INT_DATA {
8827 fn default() -> Self {
8828 Self::DEFAULT.clone()
8829 }
8830}
8831impl MessageData for COMMAND_INT_DATA {
8832 type Message = MavMessage;
8833 const ID: u32 = 75u32;
8834 const NAME: &'static str = "COMMAND_INT";
8835 const EXTRA_CRC: u8 = 158u8;
8836 const ENCODED_LEN: usize = 35usize;
8837 fn deser(
8838 _version: MavlinkVersion,
8839 __input: &[u8],
8840 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8841 let avail_len = __input.len();
8842 let mut payload_buf = [0; Self::ENCODED_LEN];
8843 let mut buf = if avail_len < Self::ENCODED_LEN {
8844 payload_buf[0..avail_len].copy_from_slice(__input);
8845 Bytes::new(&payload_buf)
8846 } else {
8847 Bytes::new(__input)
8848 };
8849 let mut __struct = Self::default();
8850 __struct.param1 = buf.get_f32_le();
8851 __struct.param2 = buf.get_f32_le();
8852 __struct.param3 = buf.get_f32_le();
8853 __struct.param4 = buf.get_f32_le();
8854 __struct.x = buf.get_i32_le();
8855 __struct.y = buf.get_i32_le();
8856 __struct.z = buf.get_f32_le();
8857 let tmp = buf.get_u16_le();
8858 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8859 ::mavlink_core::error::ParserError::InvalidEnum {
8860 enum_type: "MavCmd",
8861 value: tmp as u32,
8862 },
8863 )?;
8864 __struct.target_system = buf.get_u8();
8865 __struct.target_component = buf.get_u8();
8866 let tmp = buf.get_u8();
8867 __struct.frame =
8868 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8869 enum_type: "MavFrame",
8870 value: tmp as u32,
8871 })?;
8872 __struct.current = buf.get_u8();
8873 __struct.autocontinue = buf.get_u8();
8874 Ok(__struct)
8875 }
8876 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8877 let mut __tmp = BytesMut::new(bytes);
8878 #[allow(clippy::absurd_extreme_comparisons)]
8879 #[allow(unused_comparisons)]
8880 if __tmp.remaining() < Self::ENCODED_LEN {
8881 panic!(
8882 "buffer is too small (need {} bytes, but got {})",
8883 Self::ENCODED_LEN,
8884 __tmp.remaining(),
8885 )
8886 }
8887 __tmp.put_f32_le(self.param1);
8888 __tmp.put_f32_le(self.param2);
8889 __tmp.put_f32_le(self.param3);
8890 __tmp.put_f32_le(self.param4);
8891 __tmp.put_i32_le(self.x);
8892 __tmp.put_i32_le(self.y);
8893 __tmp.put_f32_le(self.z);
8894 __tmp.put_u16_le(self.command as u16);
8895 __tmp.put_u8(self.target_system);
8896 __tmp.put_u8(self.target_component);
8897 __tmp.put_u8(self.frame as u8);
8898 __tmp.put_u8(self.current);
8899 __tmp.put_u8(self.autocontinue);
8900 if matches!(version, MavlinkVersion::V2) {
8901 let len = __tmp.len();
8902 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8903 } else {
8904 __tmp.len()
8905 }
8906 }
8907}
8908#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8909#[doc = ""]
8910#[doc = "ID: 76"]
8911#[derive(Debug, Clone, PartialEq)]
8912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8913#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8914pub struct COMMAND_LONG_DATA {
8915 #[doc = "Parameter 1 (for the specific command)."]
8916 pub param1: f32,
8917 #[doc = "Parameter 2 (for the specific command)."]
8918 pub param2: f32,
8919 #[doc = "Parameter 3 (for the specific command)."]
8920 pub param3: f32,
8921 #[doc = "Parameter 4 (for the specific command)."]
8922 pub param4: f32,
8923 #[doc = "Parameter 5 (for the specific command)."]
8924 pub param5: f32,
8925 #[doc = "Parameter 6 (for the specific command)."]
8926 pub param6: f32,
8927 #[doc = "Parameter 7 (for the specific command)."]
8928 pub param7: f32,
8929 #[doc = "Command ID (of command to send)."]
8930 pub command: MavCmd,
8931 #[doc = "System which should execute the command"]
8932 pub target_system: u8,
8933 #[doc = "Component which should execute the command, 0 for all components"]
8934 pub target_component: u8,
8935 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
8936 pub confirmation: u8,
8937}
8938impl COMMAND_LONG_DATA {
8939 pub const ENCODED_LEN: usize = 33usize;
8940 pub const DEFAULT: Self = Self {
8941 param1: 0.0_f32,
8942 param2: 0.0_f32,
8943 param3: 0.0_f32,
8944 param4: 0.0_f32,
8945 param5: 0.0_f32,
8946 param6: 0.0_f32,
8947 param7: 0.0_f32,
8948 command: MavCmd::DEFAULT,
8949 target_system: 0_u8,
8950 target_component: 0_u8,
8951 confirmation: 0_u8,
8952 };
8953 #[cfg(feature = "arbitrary")]
8954 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8955 use arbitrary::{Arbitrary, Unstructured};
8956 let mut buf = [0u8; 1024];
8957 rng.fill_bytes(&mut buf);
8958 let mut unstructured = Unstructured::new(&buf);
8959 Self::arbitrary(&mut unstructured).unwrap_or_default()
8960 }
8961}
8962impl Default for COMMAND_LONG_DATA {
8963 fn default() -> Self {
8964 Self::DEFAULT.clone()
8965 }
8966}
8967impl MessageData for COMMAND_LONG_DATA {
8968 type Message = MavMessage;
8969 const ID: u32 = 76u32;
8970 const NAME: &'static str = "COMMAND_LONG";
8971 const EXTRA_CRC: u8 = 152u8;
8972 const ENCODED_LEN: usize = 33usize;
8973 fn deser(
8974 _version: MavlinkVersion,
8975 __input: &[u8],
8976 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8977 let avail_len = __input.len();
8978 let mut payload_buf = [0; Self::ENCODED_LEN];
8979 let mut buf = if avail_len < Self::ENCODED_LEN {
8980 payload_buf[0..avail_len].copy_from_slice(__input);
8981 Bytes::new(&payload_buf)
8982 } else {
8983 Bytes::new(__input)
8984 };
8985 let mut __struct = Self::default();
8986 __struct.param1 = buf.get_f32_le();
8987 __struct.param2 = buf.get_f32_le();
8988 __struct.param3 = buf.get_f32_le();
8989 __struct.param4 = buf.get_f32_le();
8990 __struct.param5 = buf.get_f32_le();
8991 __struct.param6 = buf.get_f32_le();
8992 __struct.param7 = buf.get_f32_le();
8993 let tmp = buf.get_u16_le();
8994 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8995 ::mavlink_core::error::ParserError::InvalidEnum {
8996 enum_type: "MavCmd",
8997 value: tmp as u32,
8998 },
8999 )?;
9000 __struct.target_system = buf.get_u8();
9001 __struct.target_component = buf.get_u8();
9002 __struct.confirmation = buf.get_u8();
9003 Ok(__struct)
9004 }
9005 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9006 let mut __tmp = BytesMut::new(bytes);
9007 #[allow(clippy::absurd_extreme_comparisons)]
9008 #[allow(unused_comparisons)]
9009 if __tmp.remaining() < Self::ENCODED_LEN {
9010 panic!(
9011 "buffer is too small (need {} bytes, but got {})",
9012 Self::ENCODED_LEN,
9013 __tmp.remaining(),
9014 )
9015 }
9016 __tmp.put_f32_le(self.param1);
9017 __tmp.put_f32_le(self.param2);
9018 __tmp.put_f32_le(self.param3);
9019 __tmp.put_f32_le(self.param4);
9020 __tmp.put_f32_le(self.param5);
9021 __tmp.put_f32_le(self.param6);
9022 __tmp.put_f32_le(self.param7);
9023 __tmp.put_u16_le(self.command as u16);
9024 __tmp.put_u8(self.target_system);
9025 __tmp.put_u8(self.target_component);
9026 __tmp.put_u8(self.confirmation);
9027 if matches!(version, MavlinkVersion::V2) {
9028 let len = __tmp.len();
9029 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9030 } else {
9031 __tmp.len()
9032 }
9033 }
9034}
9035#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9036#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9037#[doc = ""]
9038#[doc = "ID: 395"]
9039#[derive(Debug, Clone, PartialEq)]
9040#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9041#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9042pub struct COMPONENT_INFORMATION_DATA {
9043 #[doc = "Timestamp (time since system boot)."]
9044 pub time_boot_ms: u32,
9045 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9046 pub general_metadata_file_crc: u32,
9047 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9048 pub peripherals_metadata_file_crc: u32,
9049 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9050 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9051 pub general_metadata_uri: [u8; 100],
9052 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9053 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9054 pub peripherals_metadata_uri: [u8; 100],
9055}
9056impl COMPONENT_INFORMATION_DATA {
9057 pub const ENCODED_LEN: usize = 212usize;
9058 pub const DEFAULT: Self = Self {
9059 time_boot_ms: 0_u32,
9060 general_metadata_file_crc: 0_u32,
9061 peripherals_metadata_file_crc: 0_u32,
9062 general_metadata_uri: [0_u8; 100usize],
9063 peripherals_metadata_uri: [0_u8; 100usize],
9064 };
9065 #[cfg(feature = "arbitrary")]
9066 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9067 use arbitrary::{Arbitrary, Unstructured};
9068 let mut buf = [0u8; 1024];
9069 rng.fill_bytes(&mut buf);
9070 let mut unstructured = Unstructured::new(&buf);
9071 Self::arbitrary(&mut unstructured).unwrap_or_default()
9072 }
9073}
9074impl Default for COMPONENT_INFORMATION_DATA {
9075 fn default() -> Self {
9076 Self::DEFAULT.clone()
9077 }
9078}
9079impl MessageData for COMPONENT_INFORMATION_DATA {
9080 type Message = MavMessage;
9081 const ID: u32 = 395u32;
9082 const NAME: &'static str = "COMPONENT_INFORMATION";
9083 const EXTRA_CRC: u8 = 0u8;
9084 const ENCODED_LEN: usize = 212usize;
9085 fn deser(
9086 _version: MavlinkVersion,
9087 __input: &[u8],
9088 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9089 let avail_len = __input.len();
9090 let mut payload_buf = [0; Self::ENCODED_LEN];
9091 let mut buf = if avail_len < Self::ENCODED_LEN {
9092 payload_buf[0..avail_len].copy_from_slice(__input);
9093 Bytes::new(&payload_buf)
9094 } else {
9095 Bytes::new(__input)
9096 };
9097 let mut __struct = Self::default();
9098 __struct.time_boot_ms = buf.get_u32_le();
9099 __struct.general_metadata_file_crc = buf.get_u32_le();
9100 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9101 for v in &mut __struct.general_metadata_uri {
9102 let val = buf.get_u8();
9103 *v = val;
9104 }
9105 for v in &mut __struct.peripherals_metadata_uri {
9106 let val = buf.get_u8();
9107 *v = val;
9108 }
9109 Ok(__struct)
9110 }
9111 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9112 let mut __tmp = BytesMut::new(bytes);
9113 #[allow(clippy::absurd_extreme_comparisons)]
9114 #[allow(unused_comparisons)]
9115 if __tmp.remaining() < Self::ENCODED_LEN {
9116 panic!(
9117 "buffer is too small (need {} bytes, but got {})",
9118 Self::ENCODED_LEN,
9119 __tmp.remaining(),
9120 )
9121 }
9122 __tmp.put_u32_le(self.time_boot_ms);
9123 __tmp.put_u32_le(self.general_metadata_file_crc);
9124 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9125 for val in &self.general_metadata_uri {
9126 __tmp.put_u8(*val);
9127 }
9128 for val in &self.peripherals_metadata_uri {
9129 __tmp.put_u8(*val);
9130 }
9131 if matches!(version, MavlinkVersion::V2) {
9132 let len = __tmp.len();
9133 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9134 } else {
9135 __tmp.len()
9136 }
9137 }
9138}
9139#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9140#[doc = ""]
9141#[doc = "ID: 396"]
9142#[derive(Debug, Clone, PartialEq)]
9143#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9145pub struct COMPONENT_INFORMATION_BASIC_DATA {
9146 #[doc = "Component capability flags"]
9147 pub capabilities: MavProtocolCapability,
9148 #[doc = "Timestamp (time since system boot)."]
9149 pub time_boot_ms: u32,
9150 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9151 pub time_manufacture_s: u32,
9152 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9153 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9154 pub vendor_name: [u8; 32],
9155 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9156 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9157 pub model_name: [u8; 32],
9158 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9159 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9160 pub software_version: [u8; 24],
9161 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9162 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9163 pub hardware_version: [u8; 24],
9164 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9165 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9166 pub serial_number: [u8; 32],
9167}
9168impl COMPONENT_INFORMATION_BASIC_DATA {
9169 pub const ENCODED_LEN: usize = 160usize;
9170 pub const DEFAULT: Self = Self {
9171 capabilities: MavProtocolCapability::DEFAULT,
9172 time_boot_ms: 0_u32,
9173 time_manufacture_s: 0_u32,
9174 vendor_name: [0_u8; 32usize],
9175 model_name: [0_u8; 32usize],
9176 software_version: [0_u8; 24usize],
9177 hardware_version: [0_u8; 24usize],
9178 serial_number: [0_u8; 32usize],
9179 };
9180 #[cfg(feature = "arbitrary")]
9181 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9182 use arbitrary::{Arbitrary, Unstructured};
9183 let mut buf = [0u8; 1024];
9184 rng.fill_bytes(&mut buf);
9185 let mut unstructured = Unstructured::new(&buf);
9186 Self::arbitrary(&mut unstructured).unwrap_or_default()
9187 }
9188}
9189impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9190 fn default() -> Self {
9191 Self::DEFAULT.clone()
9192 }
9193}
9194impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9195 type Message = MavMessage;
9196 const ID: u32 = 396u32;
9197 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9198 const EXTRA_CRC: u8 = 50u8;
9199 const ENCODED_LEN: usize = 160usize;
9200 fn deser(
9201 _version: MavlinkVersion,
9202 __input: &[u8],
9203 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9204 let avail_len = __input.len();
9205 let mut payload_buf = [0; Self::ENCODED_LEN];
9206 let mut buf = if avail_len < Self::ENCODED_LEN {
9207 payload_buf[0..avail_len].copy_from_slice(__input);
9208 Bytes::new(&payload_buf)
9209 } else {
9210 Bytes::new(__input)
9211 };
9212 let mut __struct = Self::default();
9213 let tmp = buf.get_u64_le();
9214 __struct.capabilities = MavProtocolCapability::from_bits(
9215 tmp & MavProtocolCapability::all().bits(),
9216 )
9217 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9218 flag_type: "MavProtocolCapability",
9219 value: tmp as u32,
9220 })?;
9221 __struct.time_boot_ms = buf.get_u32_le();
9222 __struct.time_manufacture_s = buf.get_u32_le();
9223 for v in &mut __struct.vendor_name {
9224 let val = buf.get_u8();
9225 *v = val;
9226 }
9227 for v in &mut __struct.model_name {
9228 let val = buf.get_u8();
9229 *v = val;
9230 }
9231 for v in &mut __struct.software_version {
9232 let val = buf.get_u8();
9233 *v = val;
9234 }
9235 for v in &mut __struct.hardware_version {
9236 let val = buf.get_u8();
9237 *v = val;
9238 }
9239 for v in &mut __struct.serial_number {
9240 let val = buf.get_u8();
9241 *v = val;
9242 }
9243 Ok(__struct)
9244 }
9245 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9246 let mut __tmp = BytesMut::new(bytes);
9247 #[allow(clippy::absurd_extreme_comparisons)]
9248 #[allow(unused_comparisons)]
9249 if __tmp.remaining() < Self::ENCODED_LEN {
9250 panic!(
9251 "buffer is too small (need {} bytes, but got {})",
9252 Self::ENCODED_LEN,
9253 __tmp.remaining(),
9254 )
9255 }
9256 __tmp.put_u64_le(self.capabilities.bits());
9257 __tmp.put_u32_le(self.time_boot_ms);
9258 __tmp.put_u32_le(self.time_manufacture_s);
9259 for val in &self.vendor_name {
9260 __tmp.put_u8(*val);
9261 }
9262 for val in &self.model_name {
9263 __tmp.put_u8(*val);
9264 }
9265 for val in &self.software_version {
9266 __tmp.put_u8(*val);
9267 }
9268 for val in &self.hardware_version {
9269 __tmp.put_u8(*val);
9270 }
9271 for val in &self.serial_number {
9272 __tmp.put_u8(*val);
9273 }
9274 if matches!(version, MavlinkVersion::V2) {
9275 let len = __tmp.len();
9276 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9277 } else {
9278 __tmp.len()
9279 }
9280 }
9281}
9282#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9283#[doc = ""]
9284#[doc = "ID: 397"]
9285#[derive(Debug, Clone, PartialEq)]
9286#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9288pub struct COMPONENT_METADATA_DATA {
9289 #[doc = "Timestamp (time since system boot)."]
9290 pub time_boot_ms: u32,
9291 #[doc = "CRC32 of the general metadata file."]
9292 pub file_crc: u32,
9293 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9294 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9295 pub uri: [u8; 100],
9296}
9297impl COMPONENT_METADATA_DATA {
9298 pub const ENCODED_LEN: usize = 108usize;
9299 pub const DEFAULT: Self = Self {
9300 time_boot_ms: 0_u32,
9301 file_crc: 0_u32,
9302 uri: [0_u8; 100usize],
9303 };
9304 #[cfg(feature = "arbitrary")]
9305 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9306 use arbitrary::{Arbitrary, Unstructured};
9307 let mut buf = [0u8; 1024];
9308 rng.fill_bytes(&mut buf);
9309 let mut unstructured = Unstructured::new(&buf);
9310 Self::arbitrary(&mut unstructured).unwrap_or_default()
9311 }
9312}
9313impl Default for COMPONENT_METADATA_DATA {
9314 fn default() -> Self {
9315 Self::DEFAULT.clone()
9316 }
9317}
9318impl MessageData for COMPONENT_METADATA_DATA {
9319 type Message = MavMessage;
9320 const ID: u32 = 397u32;
9321 const NAME: &'static str = "COMPONENT_METADATA";
9322 const EXTRA_CRC: u8 = 182u8;
9323 const ENCODED_LEN: usize = 108usize;
9324 fn deser(
9325 _version: MavlinkVersion,
9326 __input: &[u8],
9327 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9328 let avail_len = __input.len();
9329 let mut payload_buf = [0; Self::ENCODED_LEN];
9330 let mut buf = if avail_len < Self::ENCODED_LEN {
9331 payload_buf[0..avail_len].copy_from_slice(__input);
9332 Bytes::new(&payload_buf)
9333 } else {
9334 Bytes::new(__input)
9335 };
9336 let mut __struct = Self::default();
9337 __struct.time_boot_ms = buf.get_u32_le();
9338 __struct.file_crc = buf.get_u32_le();
9339 for v in &mut __struct.uri {
9340 let val = buf.get_u8();
9341 *v = val;
9342 }
9343 Ok(__struct)
9344 }
9345 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9346 let mut __tmp = BytesMut::new(bytes);
9347 #[allow(clippy::absurd_extreme_comparisons)]
9348 #[allow(unused_comparisons)]
9349 if __tmp.remaining() < Self::ENCODED_LEN {
9350 panic!(
9351 "buffer is too small (need {} bytes, but got {})",
9352 Self::ENCODED_LEN,
9353 __tmp.remaining(),
9354 )
9355 }
9356 __tmp.put_u32_le(self.time_boot_ms);
9357 __tmp.put_u32_le(self.file_crc);
9358 for val in &self.uri {
9359 __tmp.put_u8(*val);
9360 }
9361 if matches!(version, MavlinkVersion::V2) {
9362 let len = __tmp.len();
9363 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9364 } else {
9365 __tmp.len()
9366 }
9367 }
9368}
9369#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9370#[doc = ""]
9371#[doc = "ID: 146"]
9372#[derive(Debug, Clone, PartialEq)]
9373#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9374#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9375pub struct CONTROL_SYSTEM_STATE_DATA {
9376 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9377 pub time_usec: u64,
9378 #[doc = "X acceleration in body frame"]
9379 pub x_acc: f32,
9380 #[doc = "Y acceleration in body frame"]
9381 pub y_acc: f32,
9382 #[doc = "Z acceleration in body frame"]
9383 pub z_acc: f32,
9384 #[doc = "X velocity in body frame"]
9385 pub x_vel: f32,
9386 #[doc = "Y velocity in body frame"]
9387 pub y_vel: f32,
9388 #[doc = "Z velocity in body frame"]
9389 pub z_vel: f32,
9390 #[doc = "X position in local frame"]
9391 pub x_pos: f32,
9392 #[doc = "Y position in local frame"]
9393 pub y_pos: f32,
9394 #[doc = "Z position in local frame"]
9395 pub z_pos: f32,
9396 #[doc = "Airspeed, set to -1 if unknown"]
9397 pub airspeed: f32,
9398 #[doc = "Variance of body velocity estimate"]
9399 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9400 pub vel_variance: [f32; 3],
9401 #[doc = "Variance in local position"]
9402 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9403 pub pos_variance: [f32; 3],
9404 #[doc = "The attitude, represented as Quaternion"]
9405 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9406 pub q: [f32; 4],
9407 #[doc = "Angular rate in roll axis"]
9408 pub roll_rate: f32,
9409 #[doc = "Angular rate in pitch axis"]
9410 pub pitch_rate: f32,
9411 #[doc = "Angular rate in yaw axis"]
9412 pub yaw_rate: f32,
9413}
9414impl CONTROL_SYSTEM_STATE_DATA {
9415 pub const ENCODED_LEN: usize = 100usize;
9416 pub const DEFAULT: Self = Self {
9417 time_usec: 0_u64,
9418 x_acc: 0.0_f32,
9419 y_acc: 0.0_f32,
9420 z_acc: 0.0_f32,
9421 x_vel: 0.0_f32,
9422 y_vel: 0.0_f32,
9423 z_vel: 0.0_f32,
9424 x_pos: 0.0_f32,
9425 y_pos: 0.0_f32,
9426 z_pos: 0.0_f32,
9427 airspeed: 0.0_f32,
9428 vel_variance: [0.0_f32; 3usize],
9429 pos_variance: [0.0_f32; 3usize],
9430 q: [0.0_f32; 4usize],
9431 roll_rate: 0.0_f32,
9432 pitch_rate: 0.0_f32,
9433 yaw_rate: 0.0_f32,
9434 };
9435 #[cfg(feature = "arbitrary")]
9436 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9437 use arbitrary::{Arbitrary, Unstructured};
9438 let mut buf = [0u8; 1024];
9439 rng.fill_bytes(&mut buf);
9440 let mut unstructured = Unstructured::new(&buf);
9441 Self::arbitrary(&mut unstructured).unwrap_or_default()
9442 }
9443}
9444impl Default for CONTROL_SYSTEM_STATE_DATA {
9445 fn default() -> Self {
9446 Self::DEFAULT.clone()
9447 }
9448}
9449impl MessageData for CONTROL_SYSTEM_STATE_DATA {
9450 type Message = MavMessage;
9451 const ID: u32 = 146u32;
9452 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
9453 const EXTRA_CRC: u8 = 103u8;
9454 const ENCODED_LEN: usize = 100usize;
9455 fn deser(
9456 _version: MavlinkVersion,
9457 __input: &[u8],
9458 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9459 let avail_len = __input.len();
9460 let mut payload_buf = [0; Self::ENCODED_LEN];
9461 let mut buf = if avail_len < Self::ENCODED_LEN {
9462 payload_buf[0..avail_len].copy_from_slice(__input);
9463 Bytes::new(&payload_buf)
9464 } else {
9465 Bytes::new(__input)
9466 };
9467 let mut __struct = Self::default();
9468 __struct.time_usec = buf.get_u64_le();
9469 __struct.x_acc = buf.get_f32_le();
9470 __struct.y_acc = buf.get_f32_le();
9471 __struct.z_acc = buf.get_f32_le();
9472 __struct.x_vel = buf.get_f32_le();
9473 __struct.y_vel = buf.get_f32_le();
9474 __struct.z_vel = buf.get_f32_le();
9475 __struct.x_pos = buf.get_f32_le();
9476 __struct.y_pos = buf.get_f32_le();
9477 __struct.z_pos = buf.get_f32_le();
9478 __struct.airspeed = buf.get_f32_le();
9479 for v in &mut __struct.vel_variance {
9480 let val = buf.get_f32_le();
9481 *v = val;
9482 }
9483 for v in &mut __struct.pos_variance {
9484 let val = buf.get_f32_le();
9485 *v = val;
9486 }
9487 for v in &mut __struct.q {
9488 let val = buf.get_f32_le();
9489 *v = val;
9490 }
9491 __struct.roll_rate = buf.get_f32_le();
9492 __struct.pitch_rate = buf.get_f32_le();
9493 __struct.yaw_rate = buf.get_f32_le();
9494 Ok(__struct)
9495 }
9496 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9497 let mut __tmp = BytesMut::new(bytes);
9498 #[allow(clippy::absurd_extreme_comparisons)]
9499 #[allow(unused_comparisons)]
9500 if __tmp.remaining() < Self::ENCODED_LEN {
9501 panic!(
9502 "buffer is too small (need {} bytes, but got {})",
9503 Self::ENCODED_LEN,
9504 __tmp.remaining(),
9505 )
9506 }
9507 __tmp.put_u64_le(self.time_usec);
9508 __tmp.put_f32_le(self.x_acc);
9509 __tmp.put_f32_le(self.y_acc);
9510 __tmp.put_f32_le(self.z_acc);
9511 __tmp.put_f32_le(self.x_vel);
9512 __tmp.put_f32_le(self.y_vel);
9513 __tmp.put_f32_le(self.z_vel);
9514 __tmp.put_f32_le(self.x_pos);
9515 __tmp.put_f32_le(self.y_pos);
9516 __tmp.put_f32_le(self.z_pos);
9517 __tmp.put_f32_le(self.airspeed);
9518 for val in &self.vel_variance {
9519 __tmp.put_f32_le(*val);
9520 }
9521 for val in &self.pos_variance {
9522 __tmp.put_f32_le(*val);
9523 }
9524 for val in &self.q {
9525 __tmp.put_f32_le(*val);
9526 }
9527 __tmp.put_f32_le(self.roll_rate);
9528 __tmp.put_f32_le(self.pitch_rate);
9529 __tmp.put_f32_le(self.yaw_rate);
9530 if matches!(version, MavlinkVersion::V2) {
9531 let len = __tmp.len();
9532 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9533 } else {
9534 __tmp.len()
9535 }
9536 }
9537}
9538#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
9539#[doc = ""]
9540#[doc = "ID: 411"]
9541#[derive(Debug, Clone, PartialEq)]
9542#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9543#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9544pub struct CURRENT_EVENT_SEQUENCE_DATA {
9545 #[doc = "Sequence number."]
9546 pub sequence: u16,
9547 #[doc = "Flag bitset."]
9548 pub flags: MavEventCurrentSequenceFlags,
9549}
9550impl CURRENT_EVENT_SEQUENCE_DATA {
9551 pub const ENCODED_LEN: usize = 3usize;
9552 pub const DEFAULT: Self = Self {
9553 sequence: 0_u16,
9554 flags: MavEventCurrentSequenceFlags::DEFAULT,
9555 };
9556 #[cfg(feature = "arbitrary")]
9557 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9558 use arbitrary::{Arbitrary, Unstructured};
9559 let mut buf = [0u8; 1024];
9560 rng.fill_bytes(&mut buf);
9561 let mut unstructured = Unstructured::new(&buf);
9562 Self::arbitrary(&mut unstructured).unwrap_or_default()
9563 }
9564}
9565impl Default for CURRENT_EVENT_SEQUENCE_DATA {
9566 fn default() -> Self {
9567 Self::DEFAULT.clone()
9568 }
9569}
9570impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
9571 type Message = MavMessage;
9572 const ID: u32 = 411u32;
9573 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
9574 const EXTRA_CRC: u8 = 106u8;
9575 const ENCODED_LEN: usize = 3usize;
9576 fn deser(
9577 _version: MavlinkVersion,
9578 __input: &[u8],
9579 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9580 let avail_len = __input.len();
9581 let mut payload_buf = [0; Self::ENCODED_LEN];
9582 let mut buf = if avail_len < Self::ENCODED_LEN {
9583 payload_buf[0..avail_len].copy_from_slice(__input);
9584 Bytes::new(&payload_buf)
9585 } else {
9586 Bytes::new(__input)
9587 };
9588 let mut __struct = Self::default();
9589 __struct.sequence = buf.get_u16_le();
9590 let tmp = buf.get_u8();
9591 __struct.flags =
9592 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9593 enum_type: "MavEventCurrentSequenceFlags",
9594 value: tmp as u32,
9595 })?;
9596 Ok(__struct)
9597 }
9598 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9599 let mut __tmp = BytesMut::new(bytes);
9600 #[allow(clippy::absurd_extreme_comparisons)]
9601 #[allow(unused_comparisons)]
9602 if __tmp.remaining() < Self::ENCODED_LEN {
9603 panic!(
9604 "buffer is too small (need {} bytes, but got {})",
9605 Self::ENCODED_LEN,
9606 __tmp.remaining(),
9607 )
9608 }
9609 __tmp.put_u16_le(self.sequence);
9610 __tmp.put_u8(self.flags as u8);
9611 if matches!(version, MavlinkVersion::V2) {
9612 let len = __tmp.len();
9613 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9614 } else {
9615 __tmp.len()
9616 }
9617 }
9618}
9619#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
9620#[doc = ""]
9621#[doc = "ID: 436"]
9622#[derive(Debug, Clone, PartialEq)]
9623#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9624#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9625pub struct CURRENT_MODE_DATA {
9626 #[doc = "A bitfield for use for autopilot-specific flags"]
9627 pub custom_mode: u32,
9628 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
9629 pub intended_custom_mode: u32,
9630 #[doc = "Standard mode."]
9631 pub standard_mode: MavStandardMode,
9632}
9633impl CURRENT_MODE_DATA {
9634 pub const ENCODED_LEN: usize = 9usize;
9635 pub const DEFAULT: Self = Self {
9636 custom_mode: 0_u32,
9637 intended_custom_mode: 0_u32,
9638 standard_mode: MavStandardMode::DEFAULT,
9639 };
9640 #[cfg(feature = "arbitrary")]
9641 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9642 use arbitrary::{Arbitrary, Unstructured};
9643 let mut buf = [0u8; 1024];
9644 rng.fill_bytes(&mut buf);
9645 let mut unstructured = Unstructured::new(&buf);
9646 Self::arbitrary(&mut unstructured).unwrap_or_default()
9647 }
9648}
9649impl Default for CURRENT_MODE_DATA {
9650 fn default() -> Self {
9651 Self::DEFAULT.clone()
9652 }
9653}
9654impl MessageData for CURRENT_MODE_DATA {
9655 type Message = MavMessage;
9656 const ID: u32 = 436u32;
9657 const NAME: &'static str = "CURRENT_MODE";
9658 const EXTRA_CRC: u8 = 193u8;
9659 const ENCODED_LEN: usize = 9usize;
9660 fn deser(
9661 _version: MavlinkVersion,
9662 __input: &[u8],
9663 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9664 let avail_len = __input.len();
9665 let mut payload_buf = [0; Self::ENCODED_LEN];
9666 let mut buf = if avail_len < Self::ENCODED_LEN {
9667 payload_buf[0..avail_len].copy_from_slice(__input);
9668 Bytes::new(&payload_buf)
9669 } else {
9670 Bytes::new(__input)
9671 };
9672 let mut __struct = Self::default();
9673 __struct.custom_mode = buf.get_u32_le();
9674 __struct.intended_custom_mode = buf.get_u32_le();
9675 let tmp = buf.get_u8();
9676 __struct.standard_mode =
9677 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9678 enum_type: "MavStandardMode",
9679 value: tmp as u32,
9680 })?;
9681 Ok(__struct)
9682 }
9683 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9684 let mut __tmp = BytesMut::new(bytes);
9685 #[allow(clippy::absurd_extreme_comparisons)]
9686 #[allow(unused_comparisons)]
9687 if __tmp.remaining() < Self::ENCODED_LEN {
9688 panic!(
9689 "buffer is too small (need {} bytes, but got {})",
9690 Self::ENCODED_LEN,
9691 __tmp.remaining(),
9692 )
9693 }
9694 __tmp.put_u32_le(self.custom_mode);
9695 __tmp.put_u32_le(self.intended_custom_mode);
9696 __tmp.put_u8(self.standard_mode as u8);
9697 if matches!(version, MavlinkVersion::V2) {
9698 let len = __tmp.len();
9699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9700 } else {
9701 __tmp.len()
9702 }
9703 }
9704}
9705#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
9706#[doc = "Data stream status information."]
9707#[doc = ""]
9708#[doc = "ID: 67"]
9709#[derive(Debug, Clone, PartialEq)]
9710#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9711#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9712pub struct DATA_STREAM_DATA {
9713 #[doc = "The message rate"]
9714 pub message_rate: u16,
9715 #[doc = "The ID of the requested data stream"]
9716 pub stream_id: u8,
9717 #[doc = "1 stream is enabled, 0 stream is stopped."]
9718 pub on_off: u8,
9719}
9720impl DATA_STREAM_DATA {
9721 pub const ENCODED_LEN: usize = 4usize;
9722 pub const DEFAULT: Self = Self {
9723 message_rate: 0_u16,
9724 stream_id: 0_u8,
9725 on_off: 0_u8,
9726 };
9727 #[cfg(feature = "arbitrary")]
9728 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9729 use arbitrary::{Arbitrary, Unstructured};
9730 let mut buf = [0u8; 1024];
9731 rng.fill_bytes(&mut buf);
9732 let mut unstructured = Unstructured::new(&buf);
9733 Self::arbitrary(&mut unstructured).unwrap_or_default()
9734 }
9735}
9736impl Default for DATA_STREAM_DATA {
9737 fn default() -> Self {
9738 Self::DEFAULT.clone()
9739 }
9740}
9741impl MessageData for DATA_STREAM_DATA {
9742 type Message = MavMessage;
9743 const ID: u32 = 67u32;
9744 const NAME: &'static str = "DATA_STREAM";
9745 const EXTRA_CRC: u8 = 21u8;
9746 const ENCODED_LEN: usize = 4usize;
9747 fn deser(
9748 _version: MavlinkVersion,
9749 __input: &[u8],
9750 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9751 let avail_len = __input.len();
9752 let mut payload_buf = [0; Self::ENCODED_LEN];
9753 let mut buf = if avail_len < Self::ENCODED_LEN {
9754 payload_buf[0..avail_len].copy_from_slice(__input);
9755 Bytes::new(&payload_buf)
9756 } else {
9757 Bytes::new(__input)
9758 };
9759 let mut __struct = Self::default();
9760 __struct.message_rate = buf.get_u16_le();
9761 __struct.stream_id = buf.get_u8();
9762 __struct.on_off = buf.get_u8();
9763 Ok(__struct)
9764 }
9765 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9766 let mut __tmp = BytesMut::new(bytes);
9767 #[allow(clippy::absurd_extreme_comparisons)]
9768 #[allow(unused_comparisons)]
9769 if __tmp.remaining() < Self::ENCODED_LEN {
9770 panic!(
9771 "buffer is too small (need {} bytes, but got {})",
9772 Self::ENCODED_LEN,
9773 __tmp.remaining(),
9774 )
9775 }
9776 __tmp.put_u16_le(self.message_rate);
9777 __tmp.put_u8(self.stream_id);
9778 __tmp.put_u8(self.on_off);
9779 if matches!(version, MavlinkVersion::V2) {
9780 let len = __tmp.len();
9781 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9782 } else {
9783 __tmp.len()
9784 }
9785 }
9786}
9787#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
9788#[doc = ""]
9789#[doc = "ID: 130"]
9790#[derive(Debug, Clone, PartialEq)]
9791#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9792#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9793pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
9794 #[doc = "total data size (set on ACK only)."]
9795 pub size: u32,
9796 #[doc = "Width of a matrix or image."]
9797 pub width: u16,
9798 #[doc = "Height of a matrix or image."]
9799 pub height: u16,
9800 #[doc = "Number of packets being sent (set on ACK only)."]
9801 pub packets: u16,
9802 #[doc = "Type of requested/acknowledged data."]
9803 pub mavtype: MavlinkDataStreamType,
9804 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
9805 pub payload: u8,
9806 #[doc = "JPEG quality. Values: [1-100]."]
9807 pub jpg_quality: u8,
9808}
9809impl DATA_TRANSMISSION_HANDSHAKE_DATA {
9810 pub const ENCODED_LEN: usize = 13usize;
9811 pub const DEFAULT: Self = Self {
9812 size: 0_u32,
9813 width: 0_u16,
9814 height: 0_u16,
9815 packets: 0_u16,
9816 mavtype: MavlinkDataStreamType::DEFAULT,
9817 payload: 0_u8,
9818 jpg_quality: 0_u8,
9819 };
9820 #[cfg(feature = "arbitrary")]
9821 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9822 use arbitrary::{Arbitrary, Unstructured};
9823 let mut buf = [0u8; 1024];
9824 rng.fill_bytes(&mut buf);
9825 let mut unstructured = Unstructured::new(&buf);
9826 Self::arbitrary(&mut unstructured).unwrap_or_default()
9827 }
9828}
9829impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
9830 fn default() -> Self {
9831 Self::DEFAULT.clone()
9832 }
9833}
9834impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
9835 type Message = MavMessage;
9836 const ID: u32 = 130u32;
9837 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
9838 const EXTRA_CRC: u8 = 29u8;
9839 const ENCODED_LEN: usize = 13usize;
9840 fn deser(
9841 _version: MavlinkVersion,
9842 __input: &[u8],
9843 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9844 let avail_len = __input.len();
9845 let mut payload_buf = [0; Self::ENCODED_LEN];
9846 let mut buf = if avail_len < Self::ENCODED_LEN {
9847 payload_buf[0..avail_len].copy_from_slice(__input);
9848 Bytes::new(&payload_buf)
9849 } else {
9850 Bytes::new(__input)
9851 };
9852 let mut __struct = Self::default();
9853 __struct.size = buf.get_u32_le();
9854 __struct.width = buf.get_u16_le();
9855 __struct.height = buf.get_u16_le();
9856 __struct.packets = buf.get_u16_le();
9857 let tmp = buf.get_u8();
9858 __struct.mavtype =
9859 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9860 enum_type: "MavlinkDataStreamType",
9861 value: tmp as u32,
9862 })?;
9863 __struct.payload = buf.get_u8();
9864 __struct.jpg_quality = buf.get_u8();
9865 Ok(__struct)
9866 }
9867 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9868 let mut __tmp = BytesMut::new(bytes);
9869 #[allow(clippy::absurd_extreme_comparisons)]
9870 #[allow(unused_comparisons)]
9871 if __tmp.remaining() < Self::ENCODED_LEN {
9872 panic!(
9873 "buffer is too small (need {} bytes, but got {})",
9874 Self::ENCODED_LEN,
9875 __tmp.remaining(),
9876 )
9877 }
9878 __tmp.put_u32_le(self.size);
9879 __tmp.put_u16_le(self.width);
9880 __tmp.put_u16_le(self.height);
9881 __tmp.put_u16_le(self.packets);
9882 __tmp.put_u8(self.mavtype as u8);
9883 __tmp.put_u8(self.payload);
9884 __tmp.put_u8(self.jpg_quality);
9885 if matches!(version, MavlinkVersion::V2) {
9886 let len = __tmp.len();
9887 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9888 } else {
9889 __tmp.len()
9890 }
9891 }
9892}
9893#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
9894#[doc = ""]
9895#[doc = "ID: 254"]
9896#[derive(Debug, Clone, PartialEq)]
9897#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9898#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9899pub struct DEBUG_DATA {
9900 #[doc = "Timestamp (time since system boot)."]
9901 pub time_boot_ms: u32,
9902 #[doc = "DEBUG value"]
9903 pub value: f32,
9904 #[doc = "index of debug variable"]
9905 pub ind: u8,
9906}
9907impl DEBUG_DATA {
9908 pub const ENCODED_LEN: usize = 9usize;
9909 pub const DEFAULT: Self = Self {
9910 time_boot_ms: 0_u32,
9911 value: 0.0_f32,
9912 ind: 0_u8,
9913 };
9914 #[cfg(feature = "arbitrary")]
9915 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9916 use arbitrary::{Arbitrary, Unstructured};
9917 let mut buf = [0u8; 1024];
9918 rng.fill_bytes(&mut buf);
9919 let mut unstructured = Unstructured::new(&buf);
9920 Self::arbitrary(&mut unstructured).unwrap_or_default()
9921 }
9922}
9923impl Default for DEBUG_DATA {
9924 fn default() -> Self {
9925 Self::DEFAULT.clone()
9926 }
9927}
9928impl MessageData for DEBUG_DATA {
9929 type Message = MavMessage;
9930 const ID: u32 = 254u32;
9931 const NAME: &'static str = "DEBUG";
9932 const EXTRA_CRC: u8 = 46u8;
9933 const ENCODED_LEN: usize = 9usize;
9934 fn deser(
9935 _version: MavlinkVersion,
9936 __input: &[u8],
9937 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9938 let avail_len = __input.len();
9939 let mut payload_buf = [0; Self::ENCODED_LEN];
9940 let mut buf = if avail_len < Self::ENCODED_LEN {
9941 payload_buf[0..avail_len].copy_from_slice(__input);
9942 Bytes::new(&payload_buf)
9943 } else {
9944 Bytes::new(__input)
9945 };
9946 let mut __struct = Self::default();
9947 __struct.time_boot_ms = buf.get_u32_le();
9948 __struct.value = buf.get_f32_le();
9949 __struct.ind = buf.get_u8();
9950 Ok(__struct)
9951 }
9952 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9953 let mut __tmp = BytesMut::new(bytes);
9954 #[allow(clippy::absurd_extreme_comparisons)]
9955 #[allow(unused_comparisons)]
9956 if __tmp.remaining() < Self::ENCODED_LEN {
9957 panic!(
9958 "buffer is too small (need {} bytes, but got {})",
9959 Self::ENCODED_LEN,
9960 __tmp.remaining(),
9961 )
9962 }
9963 __tmp.put_u32_le(self.time_boot_ms);
9964 __tmp.put_f32_le(self.value);
9965 __tmp.put_u8(self.ind);
9966 if matches!(version, MavlinkVersion::V2) {
9967 let len = __tmp.len();
9968 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9969 } else {
9970 __tmp.len()
9971 }
9972 }
9973}
9974#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
9975#[doc = ""]
9976#[doc = "ID: 350"]
9977#[derive(Debug, Clone, PartialEq)]
9978#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9979#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9980pub struct DEBUG_FLOAT_ARRAY_DATA {
9981 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9982 pub time_usec: u64,
9983 #[doc = "Unique ID used to discriminate between arrays"]
9984 pub array_id: u16,
9985 #[doc = "Name, for human-friendly display in a Ground Control Station"]
9986 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9987 pub name: [u8; 10],
9988 #[doc = "data"]
9989 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9990 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9991 pub data: [f32; 58],
9992}
9993impl DEBUG_FLOAT_ARRAY_DATA {
9994 pub const ENCODED_LEN: usize = 252usize;
9995 pub const DEFAULT: Self = Self {
9996 time_usec: 0_u64,
9997 array_id: 0_u16,
9998 name: [0_u8; 10usize],
9999 data: [0.0_f32; 58usize],
10000 };
10001 #[cfg(feature = "arbitrary")]
10002 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10003 use arbitrary::{Arbitrary, Unstructured};
10004 let mut buf = [0u8; 1024];
10005 rng.fill_bytes(&mut buf);
10006 let mut unstructured = Unstructured::new(&buf);
10007 Self::arbitrary(&mut unstructured).unwrap_or_default()
10008 }
10009}
10010impl Default for DEBUG_FLOAT_ARRAY_DATA {
10011 fn default() -> Self {
10012 Self::DEFAULT.clone()
10013 }
10014}
10015impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10016 type Message = MavMessage;
10017 const ID: u32 = 350u32;
10018 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10019 const EXTRA_CRC: u8 = 232u8;
10020 const ENCODED_LEN: usize = 252usize;
10021 fn deser(
10022 _version: MavlinkVersion,
10023 __input: &[u8],
10024 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10025 let avail_len = __input.len();
10026 let mut payload_buf = [0; Self::ENCODED_LEN];
10027 let mut buf = if avail_len < Self::ENCODED_LEN {
10028 payload_buf[0..avail_len].copy_from_slice(__input);
10029 Bytes::new(&payload_buf)
10030 } else {
10031 Bytes::new(__input)
10032 };
10033 let mut __struct = Self::default();
10034 __struct.time_usec = buf.get_u64_le();
10035 __struct.array_id = buf.get_u16_le();
10036 for v in &mut __struct.name {
10037 let val = buf.get_u8();
10038 *v = val;
10039 }
10040 for v in &mut __struct.data {
10041 let val = buf.get_f32_le();
10042 *v = val;
10043 }
10044 Ok(__struct)
10045 }
10046 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10047 let mut __tmp = BytesMut::new(bytes);
10048 #[allow(clippy::absurd_extreme_comparisons)]
10049 #[allow(unused_comparisons)]
10050 if __tmp.remaining() < Self::ENCODED_LEN {
10051 panic!(
10052 "buffer is too small (need {} bytes, but got {})",
10053 Self::ENCODED_LEN,
10054 __tmp.remaining(),
10055 )
10056 }
10057 __tmp.put_u64_le(self.time_usec);
10058 __tmp.put_u16_le(self.array_id);
10059 for val in &self.name {
10060 __tmp.put_u8(*val);
10061 }
10062 if matches!(version, MavlinkVersion::V2) {
10063 for val in &self.data {
10064 __tmp.put_f32_le(*val);
10065 }
10066 let len = __tmp.len();
10067 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10068 } else {
10069 __tmp.len()
10070 }
10071 }
10072}
10073#[doc = "To debug something using a named 3D vector."]
10074#[doc = ""]
10075#[doc = "ID: 250"]
10076#[derive(Debug, Clone, PartialEq)]
10077#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10078#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10079pub struct DEBUG_VECT_DATA {
10080 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10081 pub time_usec: u64,
10082 #[doc = "x"]
10083 pub x: f32,
10084 #[doc = "y"]
10085 pub y: f32,
10086 #[doc = "z"]
10087 pub z: f32,
10088 #[doc = "Name"]
10089 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10090 pub name: [u8; 10],
10091}
10092impl DEBUG_VECT_DATA {
10093 pub const ENCODED_LEN: usize = 30usize;
10094 pub const DEFAULT: Self = Self {
10095 time_usec: 0_u64,
10096 x: 0.0_f32,
10097 y: 0.0_f32,
10098 z: 0.0_f32,
10099 name: [0_u8; 10usize],
10100 };
10101 #[cfg(feature = "arbitrary")]
10102 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10103 use arbitrary::{Arbitrary, Unstructured};
10104 let mut buf = [0u8; 1024];
10105 rng.fill_bytes(&mut buf);
10106 let mut unstructured = Unstructured::new(&buf);
10107 Self::arbitrary(&mut unstructured).unwrap_or_default()
10108 }
10109}
10110impl Default for DEBUG_VECT_DATA {
10111 fn default() -> Self {
10112 Self::DEFAULT.clone()
10113 }
10114}
10115impl MessageData for DEBUG_VECT_DATA {
10116 type Message = MavMessage;
10117 const ID: u32 = 250u32;
10118 const NAME: &'static str = "DEBUG_VECT";
10119 const EXTRA_CRC: u8 = 49u8;
10120 const ENCODED_LEN: usize = 30usize;
10121 fn deser(
10122 _version: MavlinkVersion,
10123 __input: &[u8],
10124 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10125 let avail_len = __input.len();
10126 let mut payload_buf = [0; Self::ENCODED_LEN];
10127 let mut buf = if avail_len < Self::ENCODED_LEN {
10128 payload_buf[0..avail_len].copy_from_slice(__input);
10129 Bytes::new(&payload_buf)
10130 } else {
10131 Bytes::new(__input)
10132 };
10133 let mut __struct = Self::default();
10134 __struct.time_usec = buf.get_u64_le();
10135 __struct.x = buf.get_f32_le();
10136 __struct.y = buf.get_f32_le();
10137 __struct.z = buf.get_f32_le();
10138 for v in &mut __struct.name {
10139 let val = buf.get_u8();
10140 *v = val;
10141 }
10142 Ok(__struct)
10143 }
10144 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10145 let mut __tmp = BytesMut::new(bytes);
10146 #[allow(clippy::absurd_extreme_comparisons)]
10147 #[allow(unused_comparisons)]
10148 if __tmp.remaining() < Self::ENCODED_LEN {
10149 panic!(
10150 "buffer is too small (need {} bytes, but got {})",
10151 Self::ENCODED_LEN,
10152 __tmp.remaining(),
10153 )
10154 }
10155 __tmp.put_u64_le(self.time_usec);
10156 __tmp.put_f32_le(self.x);
10157 __tmp.put_f32_le(self.y);
10158 __tmp.put_f32_le(self.z);
10159 for val in &self.name {
10160 __tmp.put_u8(*val);
10161 }
10162 if matches!(version, MavlinkVersion::V2) {
10163 let len = __tmp.len();
10164 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10165 } else {
10166 __tmp.len()
10167 }
10168 }
10169}
10170#[doc = "Distance sensor information for an onboard rangefinder."]
10171#[doc = ""]
10172#[doc = "ID: 132"]
10173#[derive(Debug, Clone, PartialEq)]
10174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10175#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10176pub struct DISTANCE_SENSOR_DATA {
10177 #[doc = "Timestamp (time since system boot)."]
10178 pub time_boot_ms: u32,
10179 #[doc = "Minimum distance the sensor can measure"]
10180 pub min_distance: u16,
10181 #[doc = "Maximum distance the sensor can measure"]
10182 pub max_distance: u16,
10183 #[doc = "Current distance reading"]
10184 pub current_distance: u16,
10185 #[doc = "Type of distance sensor."]
10186 pub mavtype: MavDistanceSensor,
10187 #[doc = "Onboard ID of the sensor"]
10188 pub id: u8,
10189 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10190 pub orientation: MavSensorOrientation,
10191 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10192 pub covariance: u8,
10193 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10194 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10195 pub horizontal_fov: f32,
10196 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10197 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10198 pub vertical_fov: f32,
10199 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10200 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10201 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10202 pub quaternion: [f32; 4],
10203 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10204 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10205 pub signal_quality: u8,
10206}
10207impl DISTANCE_SENSOR_DATA {
10208 pub const ENCODED_LEN: usize = 39usize;
10209 pub const DEFAULT: Self = Self {
10210 time_boot_ms: 0_u32,
10211 min_distance: 0_u16,
10212 max_distance: 0_u16,
10213 current_distance: 0_u16,
10214 mavtype: MavDistanceSensor::DEFAULT,
10215 id: 0_u8,
10216 orientation: MavSensorOrientation::DEFAULT,
10217 covariance: 0_u8,
10218 horizontal_fov: 0.0_f32,
10219 vertical_fov: 0.0_f32,
10220 quaternion: [0.0_f32; 4usize],
10221 signal_quality: 0_u8,
10222 };
10223 #[cfg(feature = "arbitrary")]
10224 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10225 use arbitrary::{Arbitrary, Unstructured};
10226 let mut buf = [0u8; 1024];
10227 rng.fill_bytes(&mut buf);
10228 let mut unstructured = Unstructured::new(&buf);
10229 Self::arbitrary(&mut unstructured).unwrap_or_default()
10230 }
10231}
10232impl Default for DISTANCE_SENSOR_DATA {
10233 fn default() -> Self {
10234 Self::DEFAULT.clone()
10235 }
10236}
10237impl MessageData for DISTANCE_SENSOR_DATA {
10238 type Message = MavMessage;
10239 const ID: u32 = 132u32;
10240 const NAME: &'static str = "DISTANCE_SENSOR";
10241 const EXTRA_CRC: u8 = 85u8;
10242 const ENCODED_LEN: usize = 39usize;
10243 fn deser(
10244 _version: MavlinkVersion,
10245 __input: &[u8],
10246 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10247 let avail_len = __input.len();
10248 let mut payload_buf = [0; Self::ENCODED_LEN];
10249 let mut buf = if avail_len < Self::ENCODED_LEN {
10250 payload_buf[0..avail_len].copy_from_slice(__input);
10251 Bytes::new(&payload_buf)
10252 } else {
10253 Bytes::new(__input)
10254 };
10255 let mut __struct = Self::default();
10256 __struct.time_boot_ms = buf.get_u32_le();
10257 __struct.min_distance = buf.get_u16_le();
10258 __struct.max_distance = buf.get_u16_le();
10259 __struct.current_distance = buf.get_u16_le();
10260 let tmp = buf.get_u8();
10261 __struct.mavtype =
10262 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10263 enum_type: "MavDistanceSensor",
10264 value: tmp as u32,
10265 })?;
10266 __struct.id = buf.get_u8();
10267 let tmp = buf.get_u8();
10268 __struct.orientation =
10269 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10270 enum_type: "MavSensorOrientation",
10271 value: tmp as u32,
10272 })?;
10273 __struct.covariance = buf.get_u8();
10274 __struct.horizontal_fov = buf.get_f32_le();
10275 __struct.vertical_fov = buf.get_f32_le();
10276 for v in &mut __struct.quaternion {
10277 let val = buf.get_f32_le();
10278 *v = val;
10279 }
10280 __struct.signal_quality = buf.get_u8();
10281 Ok(__struct)
10282 }
10283 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10284 let mut __tmp = BytesMut::new(bytes);
10285 #[allow(clippy::absurd_extreme_comparisons)]
10286 #[allow(unused_comparisons)]
10287 if __tmp.remaining() < Self::ENCODED_LEN {
10288 panic!(
10289 "buffer is too small (need {} bytes, but got {})",
10290 Self::ENCODED_LEN,
10291 __tmp.remaining(),
10292 )
10293 }
10294 __tmp.put_u32_le(self.time_boot_ms);
10295 __tmp.put_u16_le(self.min_distance);
10296 __tmp.put_u16_le(self.max_distance);
10297 __tmp.put_u16_le(self.current_distance);
10298 __tmp.put_u8(self.mavtype as u8);
10299 __tmp.put_u8(self.id);
10300 __tmp.put_u8(self.orientation as u8);
10301 __tmp.put_u8(self.covariance);
10302 if matches!(version, MavlinkVersion::V2) {
10303 __tmp.put_f32_le(self.horizontal_fov);
10304 __tmp.put_f32_le(self.vertical_fov);
10305 for val in &self.quaternion {
10306 __tmp.put_f32_le(*val);
10307 }
10308 __tmp.put_u8(self.signal_quality);
10309 let len = __tmp.len();
10310 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10311 } else {
10312 __tmp.len()
10313 }
10314 }
10315}
10316#[doc = "EFI status output."]
10317#[doc = ""]
10318#[doc = "ID: 225"]
10319#[derive(Debug, Clone, PartialEq)]
10320#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10321#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10322pub struct EFI_STATUS_DATA {
10323 #[doc = "ECU index"]
10324 pub ecu_index: f32,
10325 #[doc = "RPM"]
10326 pub rpm: f32,
10327 #[doc = "Fuel consumed"]
10328 pub fuel_consumed: f32,
10329 #[doc = "Fuel flow rate"]
10330 pub fuel_flow: f32,
10331 #[doc = "Engine load"]
10332 pub engine_load: f32,
10333 #[doc = "Throttle position"]
10334 pub throttle_position: f32,
10335 #[doc = "Spark dwell time"]
10336 pub spark_dwell_time: f32,
10337 #[doc = "Barometric pressure"]
10338 pub barometric_pressure: f32,
10339 #[doc = "Intake manifold pressure("]
10340 pub intake_manifold_pressure: f32,
10341 #[doc = "Intake manifold temperature"]
10342 pub intake_manifold_temperature: f32,
10343 #[doc = "Cylinder head temperature"]
10344 pub cylinder_head_temperature: f32,
10345 #[doc = "Ignition timing (Crank angle degrees)"]
10346 pub ignition_timing: f32,
10347 #[doc = "Injection time"]
10348 pub injection_time: f32,
10349 #[doc = "Exhaust gas temperature"]
10350 pub exhaust_gas_temperature: f32,
10351 #[doc = "Output throttle"]
10352 pub throttle_out: f32,
10353 #[doc = "Pressure/temperature compensation"]
10354 pub pt_compensation: f32,
10355 #[doc = "EFI health status"]
10356 pub health: u8,
10357 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10358 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10359 pub ignition_voltage: f32,
10360 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
10361 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10362 pub fuel_pressure: f32,
10363}
10364impl EFI_STATUS_DATA {
10365 pub const ENCODED_LEN: usize = 73usize;
10366 pub const DEFAULT: Self = Self {
10367 ecu_index: 0.0_f32,
10368 rpm: 0.0_f32,
10369 fuel_consumed: 0.0_f32,
10370 fuel_flow: 0.0_f32,
10371 engine_load: 0.0_f32,
10372 throttle_position: 0.0_f32,
10373 spark_dwell_time: 0.0_f32,
10374 barometric_pressure: 0.0_f32,
10375 intake_manifold_pressure: 0.0_f32,
10376 intake_manifold_temperature: 0.0_f32,
10377 cylinder_head_temperature: 0.0_f32,
10378 ignition_timing: 0.0_f32,
10379 injection_time: 0.0_f32,
10380 exhaust_gas_temperature: 0.0_f32,
10381 throttle_out: 0.0_f32,
10382 pt_compensation: 0.0_f32,
10383 health: 0_u8,
10384 ignition_voltage: 0.0_f32,
10385 fuel_pressure: 0.0_f32,
10386 };
10387 #[cfg(feature = "arbitrary")]
10388 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10389 use arbitrary::{Arbitrary, Unstructured};
10390 let mut buf = [0u8; 1024];
10391 rng.fill_bytes(&mut buf);
10392 let mut unstructured = Unstructured::new(&buf);
10393 Self::arbitrary(&mut unstructured).unwrap_or_default()
10394 }
10395}
10396impl Default for EFI_STATUS_DATA {
10397 fn default() -> Self {
10398 Self::DEFAULT.clone()
10399 }
10400}
10401impl MessageData for EFI_STATUS_DATA {
10402 type Message = MavMessage;
10403 const ID: u32 = 225u32;
10404 const NAME: &'static str = "EFI_STATUS";
10405 const EXTRA_CRC: u8 = 208u8;
10406 const ENCODED_LEN: usize = 73usize;
10407 fn deser(
10408 _version: MavlinkVersion,
10409 __input: &[u8],
10410 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10411 let avail_len = __input.len();
10412 let mut payload_buf = [0; Self::ENCODED_LEN];
10413 let mut buf = if avail_len < Self::ENCODED_LEN {
10414 payload_buf[0..avail_len].copy_from_slice(__input);
10415 Bytes::new(&payload_buf)
10416 } else {
10417 Bytes::new(__input)
10418 };
10419 let mut __struct = Self::default();
10420 __struct.ecu_index = buf.get_f32_le();
10421 __struct.rpm = buf.get_f32_le();
10422 __struct.fuel_consumed = buf.get_f32_le();
10423 __struct.fuel_flow = buf.get_f32_le();
10424 __struct.engine_load = buf.get_f32_le();
10425 __struct.throttle_position = buf.get_f32_le();
10426 __struct.spark_dwell_time = buf.get_f32_le();
10427 __struct.barometric_pressure = buf.get_f32_le();
10428 __struct.intake_manifold_pressure = buf.get_f32_le();
10429 __struct.intake_manifold_temperature = buf.get_f32_le();
10430 __struct.cylinder_head_temperature = buf.get_f32_le();
10431 __struct.ignition_timing = buf.get_f32_le();
10432 __struct.injection_time = buf.get_f32_le();
10433 __struct.exhaust_gas_temperature = buf.get_f32_le();
10434 __struct.throttle_out = buf.get_f32_le();
10435 __struct.pt_compensation = buf.get_f32_le();
10436 __struct.health = buf.get_u8();
10437 __struct.ignition_voltage = buf.get_f32_le();
10438 __struct.fuel_pressure = buf.get_f32_le();
10439 Ok(__struct)
10440 }
10441 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10442 let mut __tmp = BytesMut::new(bytes);
10443 #[allow(clippy::absurd_extreme_comparisons)]
10444 #[allow(unused_comparisons)]
10445 if __tmp.remaining() < Self::ENCODED_LEN {
10446 panic!(
10447 "buffer is too small (need {} bytes, but got {})",
10448 Self::ENCODED_LEN,
10449 __tmp.remaining(),
10450 )
10451 }
10452 __tmp.put_f32_le(self.ecu_index);
10453 __tmp.put_f32_le(self.rpm);
10454 __tmp.put_f32_le(self.fuel_consumed);
10455 __tmp.put_f32_le(self.fuel_flow);
10456 __tmp.put_f32_le(self.engine_load);
10457 __tmp.put_f32_le(self.throttle_position);
10458 __tmp.put_f32_le(self.spark_dwell_time);
10459 __tmp.put_f32_le(self.barometric_pressure);
10460 __tmp.put_f32_le(self.intake_manifold_pressure);
10461 __tmp.put_f32_le(self.intake_manifold_temperature);
10462 __tmp.put_f32_le(self.cylinder_head_temperature);
10463 __tmp.put_f32_le(self.ignition_timing);
10464 __tmp.put_f32_le(self.injection_time);
10465 __tmp.put_f32_le(self.exhaust_gas_temperature);
10466 __tmp.put_f32_le(self.throttle_out);
10467 __tmp.put_f32_le(self.pt_compensation);
10468 __tmp.put_u8(self.health);
10469 if matches!(version, MavlinkVersion::V2) {
10470 __tmp.put_f32_le(self.ignition_voltage);
10471 __tmp.put_f32_le(self.fuel_pressure);
10472 let len = __tmp.len();
10473 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10474 } else {
10475 __tmp.len()
10476 }
10477 }
10478}
10479#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10480#[doc = ""]
10481#[doc = "ID: 131"]
10482#[derive(Debug, Clone, PartialEq)]
10483#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10484#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10485pub struct ENCAPSULATED_DATA_DATA {
10486 #[doc = "sequence number (starting with 0 on every transmission)"]
10487 pub seqnr: u16,
10488 #[doc = "image data bytes"]
10489 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10490 pub data: [u8; 253],
10491}
10492impl ENCAPSULATED_DATA_DATA {
10493 pub const ENCODED_LEN: usize = 255usize;
10494 pub const DEFAULT: Self = Self {
10495 seqnr: 0_u16,
10496 data: [0_u8; 253usize],
10497 };
10498 #[cfg(feature = "arbitrary")]
10499 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10500 use arbitrary::{Arbitrary, Unstructured};
10501 let mut buf = [0u8; 1024];
10502 rng.fill_bytes(&mut buf);
10503 let mut unstructured = Unstructured::new(&buf);
10504 Self::arbitrary(&mut unstructured).unwrap_or_default()
10505 }
10506}
10507impl Default for ENCAPSULATED_DATA_DATA {
10508 fn default() -> Self {
10509 Self::DEFAULT.clone()
10510 }
10511}
10512impl MessageData for ENCAPSULATED_DATA_DATA {
10513 type Message = MavMessage;
10514 const ID: u32 = 131u32;
10515 const NAME: &'static str = "ENCAPSULATED_DATA";
10516 const EXTRA_CRC: u8 = 223u8;
10517 const ENCODED_LEN: usize = 255usize;
10518 fn deser(
10519 _version: MavlinkVersion,
10520 __input: &[u8],
10521 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10522 let avail_len = __input.len();
10523 let mut payload_buf = [0; Self::ENCODED_LEN];
10524 let mut buf = if avail_len < Self::ENCODED_LEN {
10525 payload_buf[0..avail_len].copy_from_slice(__input);
10526 Bytes::new(&payload_buf)
10527 } else {
10528 Bytes::new(__input)
10529 };
10530 let mut __struct = Self::default();
10531 __struct.seqnr = buf.get_u16_le();
10532 for v in &mut __struct.data {
10533 let val = buf.get_u8();
10534 *v = val;
10535 }
10536 Ok(__struct)
10537 }
10538 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10539 let mut __tmp = BytesMut::new(bytes);
10540 #[allow(clippy::absurd_extreme_comparisons)]
10541 #[allow(unused_comparisons)]
10542 if __tmp.remaining() < Self::ENCODED_LEN {
10543 panic!(
10544 "buffer is too small (need {} bytes, but got {})",
10545 Self::ENCODED_LEN,
10546 __tmp.remaining(),
10547 )
10548 }
10549 __tmp.put_u16_le(self.seqnr);
10550 for val in &self.data {
10551 __tmp.put_u8(*val);
10552 }
10553 if matches!(version, MavlinkVersion::V2) {
10554 let len = __tmp.len();
10555 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10556 } else {
10557 __tmp.len()
10558 }
10559 }
10560}
10561#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
10562#[doc = ""]
10563#[doc = "ID: 290"]
10564#[derive(Debug, Clone, PartialEq)]
10565#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10566#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10567pub struct ESC_INFO_DATA {
10568 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
10569 pub time_usec: u64,
10570 #[doc = "Number of reported errors by each ESC since boot."]
10571 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10572 pub error_count: [u32; 4],
10573 #[doc = "Counter of data packets received."]
10574 pub counter: u16,
10575 #[doc = "Bitmap of ESC failure flags."]
10576 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10577 pub failure_flags: [u16; 4],
10578 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
10579 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10580 pub temperature: [i16; 4],
10581 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
10582 pub index: u8,
10583 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
10584 pub count: u8,
10585 #[doc = "Connection type protocol for all ESC."]
10586 pub connection_type: EscConnectionType,
10587 #[doc = "Information regarding online/offline status of each ESC."]
10588 pub info: u8,
10589}
10590impl ESC_INFO_DATA {
10591 pub const ENCODED_LEN: usize = 46usize;
10592 pub const DEFAULT: Self = Self {
10593 time_usec: 0_u64,
10594 error_count: [0_u32; 4usize],
10595 counter: 0_u16,
10596 failure_flags: [0_u16; 4usize],
10597 temperature: [0_i16; 4usize],
10598 index: 0_u8,
10599 count: 0_u8,
10600 connection_type: EscConnectionType::DEFAULT,
10601 info: 0_u8,
10602 };
10603 #[cfg(feature = "arbitrary")]
10604 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10605 use arbitrary::{Arbitrary, Unstructured};
10606 let mut buf = [0u8; 1024];
10607 rng.fill_bytes(&mut buf);
10608 let mut unstructured = Unstructured::new(&buf);
10609 Self::arbitrary(&mut unstructured).unwrap_or_default()
10610 }
10611}
10612impl Default for ESC_INFO_DATA {
10613 fn default() -> Self {
10614 Self::DEFAULT.clone()
10615 }
10616}
10617impl MessageData for ESC_INFO_DATA {
10618 type Message = MavMessage;
10619 const ID: u32 = 290u32;
10620 const NAME: &'static str = "ESC_INFO";
10621 const EXTRA_CRC: u8 = 251u8;
10622 const ENCODED_LEN: usize = 46usize;
10623 fn deser(
10624 _version: MavlinkVersion,
10625 __input: &[u8],
10626 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10627 let avail_len = __input.len();
10628 let mut payload_buf = [0; Self::ENCODED_LEN];
10629 let mut buf = if avail_len < Self::ENCODED_LEN {
10630 payload_buf[0..avail_len].copy_from_slice(__input);
10631 Bytes::new(&payload_buf)
10632 } else {
10633 Bytes::new(__input)
10634 };
10635 let mut __struct = Self::default();
10636 __struct.time_usec = buf.get_u64_le();
10637 for v in &mut __struct.error_count {
10638 let val = buf.get_u32_le();
10639 *v = val;
10640 }
10641 __struct.counter = buf.get_u16_le();
10642 for v in &mut __struct.failure_flags {
10643 let val = buf.get_u16_le();
10644 *v = val;
10645 }
10646 for v in &mut __struct.temperature {
10647 let val = buf.get_i16_le();
10648 *v = val;
10649 }
10650 __struct.index = buf.get_u8();
10651 __struct.count = buf.get_u8();
10652 let tmp = buf.get_u8();
10653 __struct.connection_type =
10654 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10655 enum_type: "EscConnectionType",
10656 value: tmp as u32,
10657 })?;
10658 __struct.info = buf.get_u8();
10659 Ok(__struct)
10660 }
10661 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10662 let mut __tmp = BytesMut::new(bytes);
10663 #[allow(clippy::absurd_extreme_comparisons)]
10664 #[allow(unused_comparisons)]
10665 if __tmp.remaining() < Self::ENCODED_LEN {
10666 panic!(
10667 "buffer is too small (need {} bytes, but got {})",
10668 Self::ENCODED_LEN,
10669 __tmp.remaining(),
10670 )
10671 }
10672 __tmp.put_u64_le(self.time_usec);
10673 for val in &self.error_count {
10674 __tmp.put_u32_le(*val);
10675 }
10676 __tmp.put_u16_le(self.counter);
10677 for val in &self.failure_flags {
10678 __tmp.put_u16_le(*val);
10679 }
10680 for val in &self.temperature {
10681 __tmp.put_i16_le(*val);
10682 }
10683 __tmp.put_u8(self.index);
10684 __tmp.put_u8(self.count);
10685 __tmp.put_u8(self.connection_type as u8);
10686 __tmp.put_u8(self.info);
10687 if matches!(version, MavlinkVersion::V2) {
10688 let len = __tmp.len();
10689 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10690 } else {
10691 __tmp.len()
10692 }
10693 }
10694}
10695#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
10696#[doc = ""]
10697#[doc = "ID: 291"]
10698#[derive(Debug, Clone, PartialEq)]
10699#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10700#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10701pub struct ESC_STATUS_DATA {
10702 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
10703 pub time_usec: u64,
10704 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
10705 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10706 pub rpm: [i32; 4],
10707 #[doc = "Voltage measured from each ESC."]
10708 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10709 pub voltage: [f32; 4],
10710 #[doc = "Current measured from each ESC."]
10711 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10712 pub current: [f32; 4],
10713 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
10714 pub index: u8,
10715}
10716impl ESC_STATUS_DATA {
10717 pub const ENCODED_LEN: usize = 57usize;
10718 pub const DEFAULT: Self = Self {
10719 time_usec: 0_u64,
10720 rpm: [0_i32; 4usize],
10721 voltage: [0.0_f32; 4usize],
10722 current: [0.0_f32; 4usize],
10723 index: 0_u8,
10724 };
10725 #[cfg(feature = "arbitrary")]
10726 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10727 use arbitrary::{Arbitrary, Unstructured};
10728 let mut buf = [0u8; 1024];
10729 rng.fill_bytes(&mut buf);
10730 let mut unstructured = Unstructured::new(&buf);
10731 Self::arbitrary(&mut unstructured).unwrap_or_default()
10732 }
10733}
10734impl Default for ESC_STATUS_DATA {
10735 fn default() -> Self {
10736 Self::DEFAULT.clone()
10737 }
10738}
10739impl MessageData for ESC_STATUS_DATA {
10740 type Message = MavMessage;
10741 const ID: u32 = 291u32;
10742 const NAME: &'static str = "ESC_STATUS";
10743 const EXTRA_CRC: u8 = 10u8;
10744 const ENCODED_LEN: usize = 57usize;
10745 fn deser(
10746 _version: MavlinkVersion,
10747 __input: &[u8],
10748 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10749 let avail_len = __input.len();
10750 let mut payload_buf = [0; Self::ENCODED_LEN];
10751 let mut buf = if avail_len < Self::ENCODED_LEN {
10752 payload_buf[0..avail_len].copy_from_slice(__input);
10753 Bytes::new(&payload_buf)
10754 } else {
10755 Bytes::new(__input)
10756 };
10757 let mut __struct = Self::default();
10758 __struct.time_usec = buf.get_u64_le();
10759 for v in &mut __struct.rpm {
10760 let val = buf.get_i32_le();
10761 *v = val;
10762 }
10763 for v in &mut __struct.voltage {
10764 let val = buf.get_f32_le();
10765 *v = val;
10766 }
10767 for v in &mut __struct.current {
10768 let val = buf.get_f32_le();
10769 *v = val;
10770 }
10771 __struct.index = buf.get_u8();
10772 Ok(__struct)
10773 }
10774 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10775 let mut __tmp = BytesMut::new(bytes);
10776 #[allow(clippy::absurd_extreme_comparisons)]
10777 #[allow(unused_comparisons)]
10778 if __tmp.remaining() < Self::ENCODED_LEN {
10779 panic!(
10780 "buffer is too small (need {} bytes, but got {})",
10781 Self::ENCODED_LEN,
10782 __tmp.remaining(),
10783 )
10784 }
10785 __tmp.put_u64_le(self.time_usec);
10786 for val in &self.rpm {
10787 __tmp.put_i32_le(*val);
10788 }
10789 for val in &self.voltage {
10790 __tmp.put_f32_le(*val);
10791 }
10792 for val in &self.current {
10793 __tmp.put_f32_le(*val);
10794 }
10795 __tmp.put_u8(self.index);
10796 if matches!(version, MavlinkVersion::V2) {
10797 let len = __tmp.len();
10798 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10799 } else {
10800 __tmp.len()
10801 }
10802 }
10803}
10804#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
10805#[doc = ""]
10806#[doc = "ID: 230"]
10807#[derive(Debug, Clone, PartialEq)]
10808#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10809#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10810pub struct ESTIMATOR_STATUS_DATA {
10811 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10812 pub time_usec: u64,
10813 #[doc = "Velocity innovation test ratio"]
10814 pub vel_ratio: f32,
10815 #[doc = "Horizontal position innovation test ratio"]
10816 pub pos_horiz_ratio: f32,
10817 #[doc = "Vertical position innovation test ratio"]
10818 pub pos_vert_ratio: f32,
10819 #[doc = "Magnetometer innovation test ratio"]
10820 pub mag_ratio: f32,
10821 #[doc = "Height above terrain innovation test ratio"]
10822 pub hagl_ratio: f32,
10823 #[doc = "True airspeed innovation test ratio"]
10824 pub tas_ratio: f32,
10825 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
10826 pub pos_horiz_accuracy: f32,
10827 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
10828 pub pos_vert_accuracy: f32,
10829 #[doc = "Bitmap indicating which EKF outputs are valid."]
10830 pub flags: EstimatorStatusFlags,
10831}
10832impl ESTIMATOR_STATUS_DATA {
10833 pub const ENCODED_LEN: usize = 42usize;
10834 pub const DEFAULT: Self = Self {
10835 time_usec: 0_u64,
10836 vel_ratio: 0.0_f32,
10837 pos_horiz_ratio: 0.0_f32,
10838 pos_vert_ratio: 0.0_f32,
10839 mag_ratio: 0.0_f32,
10840 hagl_ratio: 0.0_f32,
10841 tas_ratio: 0.0_f32,
10842 pos_horiz_accuracy: 0.0_f32,
10843 pos_vert_accuracy: 0.0_f32,
10844 flags: EstimatorStatusFlags::DEFAULT,
10845 };
10846 #[cfg(feature = "arbitrary")]
10847 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10848 use arbitrary::{Arbitrary, Unstructured};
10849 let mut buf = [0u8; 1024];
10850 rng.fill_bytes(&mut buf);
10851 let mut unstructured = Unstructured::new(&buf);
10852 Self::arbitrary(&mut unstructured).unwrap_or_default()
10853 }
10854}
10855impl Default for ESTIMATOR_STATUS_DATA {
10856 fn default() -> Self {
10857 Self::DEFAULT.clone()
10858 }
10859}
10860impl MessageData for ESTIMATOR_STATUS_DATA {
10861 type Message = MavMessage;
10862 const ID: u32 = 230u32;
10863 const NAME: &'static str = "ESTIMATOR_STATUS";
10864 const EXTRA_CRC: u8 = 163u8;
10865 const ENCODED_LEN: usize = 42usize;
10866 fn deser(
10867 _version: MavlinkVersion,
10868 __input: &[u8],
10869 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10870 let avail_len = __input.len();
10871 let mut payload_buf = [0; Self::ENCODED_LEN];
10872 let mut buf = if avail_len < Self::ENCODED_LEN {
10873 payload_buf[0..avail_len].copy_from_slice(__input);
10874 Bytes::new(&payload_buf)
10875 } else {
10876 Bytes::new(__input)
10877 };
10878 let mut __struct = Self::default();
10879 __struct.time_usec = buf.get_u64_le();
10880 __struct.vel_ratio = buf.get_f32_le();
10881 __struct.pos_horiz_ratio = buf.get_f32_le();
10882 __struct.pos_vert_ratio = buf.get_f32_le();
10883 __struct.mag_ratio = buf.get_f32_le();
10884 __struct.hagl_ratio = buf.get_f32_le();
10885 __struct.tas_ratio = buf.get_f32_le();
10886 __struct.pos_horiz_accuracy = buf.get_f32_le();
10887 __struct.pos_vert_accuracy = buf.get_f32_le();
10888 let tmp = buf.get_u16_le();
10889 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
10890 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
10891 flag_type: "EstimatorStatusFlags",
10892 value: tmp as u32,
10893 })?;
10894 Ok(__struct)
10895 }
10896 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10897 let mut __tmp = BytesMut::new(bytes);
10898 #[allow(clippy::absurd_extreme_comparisons)]
10899 #[allow(unused_comparisons)]
10900 if __tmp.remaining() < Self::ENCODED_LEN {
10901 panic!(
10902 "buffer is too small (need {} bytes, but got {})",
10903 Self::ENCODED_LEN,
10904 __tmp.remaining(),
10905 )
10906 }
10907 __tmp.put_u64_le(self.time_usec);
10908 __tmp.put_f32_le(self.vel_ratio);
10909 __tmp.put_f32_le(self.pos_horiz_ratio);
10910 __tmp.put_f32_le(self.pos_vert_ratio);
10911 __tmp.put_f32_le(self.mag_ratio);
10912 __tmp.put_f32_le(self.hagl_ratio);
10913 __tmp.put_f32_le(self.tas_ratio);
10914 __tmp.put_f32_le(self.pos_horiz_accuracy);
10915 __tmp.put_f32_le(self.pos_vert_accuracy);
10916 __tmp.put_u16_le(self.flags.bits());
10917 if matches!(version, MavlinkVersion::V2) {
10918 let len = __tmp.len();
10919 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10920 } else {
10921 __tmp.len()
10922 }
10923 }
10924}
10925#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
10926#[doc = ""]
10927#[doc = "ID: 410"]
10928#[derive(Debug, Clone, PartialEq)]
10929#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10930#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10931pub struct EVENT_DATA {
10932 #[doc = "Event ID (as defined in the component metadata)"]
10933 pub id: u32,
10934 #[doc = "Timestamp (time since system boot when the event happened)."]
10935 pub event_time_boot_ms: u32,
10936 #[doc = "Sequence number."]
10937 pub sequence: u16,
10938 #[doc = "Component ID"]
10939 pub destination_component: u8,
10940 #[doc = "System ID"]
10941 pub destination_system: u8,
10942 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
10943 pub log_levels: u8,
10944 #[doc = "Arguments (depend on event ID)."]
10945 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10946 pub arguments: [u8; 40],
10947}
10948impl EVENT_DATA {
10949 pub const ENCODED_LEN: usize = 53usize;
10950 pub const DEFAULT: Self = Self {
10951 id: 0_u32,
10952 event_time_boot_ms: 0_u32,
10953 sequence: 0_u16,
10954 destination_component: 0_u8,
10955 destination_system: 0_u8,
10956 log_levels: 0_u8,
10957 arguments: [0_u8; 40usize],
10958 };
10959 #[cfg(feature = "arbitrary")]
10960 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10961 use arbitrary::{Arbitrary, Unstructured};
10962 let mut buf = [0u8; 1024];
10963 rng.fill_bytes(&mut buf);
10964 let mut unstructured = Unstructured::new(&buf);
10965 Self::arbitrary(&mut unstructured).unwrap_or_default()
10966 }
10967}
10968impl Default for EVENT_DATA {
10969 fn default() -> Self {
10970 Self::DEFAULT.clone()
10971 }
10972}
10973impl MessageData for EVENT_DATA {
10974 type Message = MavMessage;
10975 const ID: u32 = 410u32;
10976 const NAME: &'static str = "EVENT";
10977 const EXTRA_CRC: u8 = 160u8;
10978 const ENCODED_LEN: usize = 53usize;
10979 fn deser(
10980 _version: MavlinkVersion,
10981 __input: &[u8],
10982 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10983 let avail_len = __input.len();
10984 let mut payload_buf = [0; Self::ENCODED_LEN];
10985 let mut buf = if avail_len < Self::ENCODED_LEN {
10986 payload_buf[0..avail_len].copy_from_slice(__input);
10987 Bytes::new(&payload_buf)
10988 } else {
10989 Bytes::new(__input)
10990 };
10991 let mut __struct = Self::default();
10992 __struct.id = buf.get_u32_le();
10993 __struct.event_time_boot_ms = buf.get_u32_le();
10994 __struct.sequence = buf.get_u16_le();
10995 __struct.destination_component = buf.get_u8();
10996 __struct.destination_system = buf.get_u8();
10997 __struct.log_levels = buf.get_u8();
10998 for v in &mut __struct.arguments {
10999 let val = buf.get_u8();
11000 *v = val;
11001 }
11002 Ok(__struct)
11003 }
11004 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11005 let mut __tmp = BytesMut::new(bytes);
11006 #[allow(clippy::absurd_extreme_comparisons)]
11007 #[allow(unused_comparisons)]
11008 if __tmp.remaining() < Self::ENCODED_LEN {
11009 panic!(
11010 "buffer is too small (need {} bytes, but got {})",
11011 Self::ENCODED_LEN,
11012 __tmp.remaining(),
11013 )
11014 }
11015 __tmp.put_u32_le(self.id);
11016 __tmp.put_u32_le(self.event_time_boot_ms);
11017 __tmp.put_u16_le(self.sequence);
11018 __tmp.put_u8(self.destination_component);
11019 __tmp.put_u8(self.destination_system);
11020 __tmp.put_u8(self.log_levels);
11021 for val in &self.arguments {
11022 __tmp.put_u8(*val);
11023 }
11024 if matches!(version, MavlinkVersion::V2) {
11025 let len = __tmp.len();
11026 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11027 } else {
11028 __tmp.len()
11029 }
11030 }
11031}
11032#[doc = "Provides state for additional features."]
11033#[doc = ""]
11034#[doc = "ID: 245"]
11035#[derive(Debug, Clone, PartialEq)]
11036#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11037#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11038pub struct EXTENDED_SYS_STATE_DATA {
11039 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11040 pub vtol_state: MavVtolState,
11041 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11042 pub landed_state: MavLandedState,
11043}
11044impl EXTENDED_SYS_STATE_DATA {
11045 pub const ENCODED_LEN: usize = 2usize;
11046 pub const DEFAULT: Self = Self {
11047 vtol_state: MavVtolState::DEFAULT,
11048 landed_state: MavLandedState::DEFAULT,
11049 };
11050 #[cfg(feature = "arbitrary")]
11051 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11052 use arbitrary::{Arbitrary, Unstructured};
11053 let mut buf = [0u8; 1024];
11054 rng.fill_bytes(&mut buf);
11055 let mut unstructured = Unstructured::new(&buf);
11056 Self::arbitrary(&mut unstructured).unwrap_or_default()
11057 }
11058}
11059impl Default for EXTENDED_SYS_STATE_DATA {
11060 fn default() -> Self {
11061 Self::DEFAULT.clone()
11062 }
11063}
11064impl MessageData for EXTENDED_SYS_STATE_DATA {
11065 type Message = MavMessage;
11066 const ID: u32 = 245u32;
11067 const NAME: &'static str = "EXTENDED_SYS_STATE";
11068 const EXTRA_CRC: u8 = 130u8;
11069 const ENCODED_LEN: usize = 2usize;
11070 fn deser(
11071 _version: MavlinkVersion,
11072 __input: &[u8],
11073 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11074 let avail_len = __input.len();
11075 let mut payload_buf = [0; Self::ENCODED_LEN];
11076 let mut buf = if avail_len < Self::ENCODED_LEN {
11077 payload_buf[0..avail_len].copy_from_slice(__input);
11078 Bytes::new(&payload_buf)
11079 } else {
11080 Bytes::new(__input)
11081 };
11082 let mut __struct = Self::default();
11083 let tmp = buf.get_u8();
11084 __struct.vtol_state =
11085 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11086 enum_type: "MavVtolState",
11087 value: tmp as u32,
11088 })?;
11089 let tmp = buf.get_u8();
11090 __struct.landed_state =
11091 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11092 enum_type: "MavLandedState",
11093 value: tmp as u32,
11094 })?;
11095 Ok(__struct)
11096 }
11097 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11098 let mut __tmp = BytesMut::new(bytes);
11099 #[allow(clippy::absurd_extreme_comparisons)]
11100 #[allow(unused_comparisons)]
11101 if __tmp.remaining() < Self::ENCODED_LEN {
11102 panic!(
11103 "buffer is too small (need {} bytes, but got {})",
11104 Self::ENCODED_LEN,
11105 __tmp.remaining(),
11106 )
11107 }
11108 __tmp.put_u8(self.vtol_state as u8);
11109 __tmp.put_u8(self.landed_state as u8);
11110 if matches!(version, MavlinkVersion::V2) {
11111 let len = __tmp.len();
11112 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11113 } else {
11114 __tmp.len()
11115 }
11116 }
11117}
11118#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11119#[doc = ""]
11120#[doc = "ID: 162"]
11121#[derive(Debug, Clone, PartialEq)]
11122#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11123#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11124pub struct FENCE_STATUS_DATA {
11125 #[doc = "Time (since boot) of last breach."]
11126 pub breach_time: u32,
11127 #[doc = "Number of fence breaches."]
11128 pub breach_count: u16,
11129 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11130 pub breach_status: u8,
11131 #[doc = "Last breach type."]
11132 pub breach_type: FenceBreach,
11133 #[doc = "Active action to prevent fence breach"]
11134 #[cfg_attr(feature = "serde", serde(default))]
11135 pub breach_mitigation: FenceMitigate,
11136}
11137impl FENCE_STATUS_DATA {
11138 pub const ENCODED_LEN: usize = 9usize;
11139 pub const DEFAULT: Self = Self {
11140 breach_time: 0_u32,
11141 breach_count: 0_u16,
11142 breach_status: 0_u8,
11143 breach_type: FenceBreach::DEFAULT,
11144 breach_mitigation: FenceMitigate::DEFAULT,
11145 };
11146 #[cfg(feature = "arbitrary")]
11147 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11148 use arbitrary::{Arbitrary, Unstructured};
11149 let mut buf = [0u8; 1024];
11150 rng.fill_bytes(&mut buf);
11151 let mut unstructured = Unstructured::new(&buf);
11152 Self::arbitrary(&mut unstructured).unwrap_or_default()
11153 }
11154}
11155impl Default for FENCE_STATUS_DATA {
11156 fn default() -> Self {
11157 Self::DEFAULT.clone()
11158 }
11159}
11160impl MessageData for FENCE_STATUS_DATA {
11161 type Message = MavMessage;
11162 const ID: u32 = 162u32;
11163 const NAME: &'static str = "FENCE_STATUS";
11164 const EXTRA_CRC: u8 = 189u8;
11165 const ENCODED_LEN: usize = 9usize;
11166 fn deser(
11167 _version: MavlinkVersion,
11168 __input: &[u8],
11169 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11170 let avail_len = __input.len();
11171 let mut payload_buf = [0; Self::ENCODED_LEN];
11172 let mut buf = if avail_len < Self::ENCODED_LEN {
11173 payload_buf[0..avail_len].copy_from_slice(__input);
11174 Bytes::new(&payload_buf)
11175 } else {
11176 Bytes::new(__input)
11177 };
11178 let mut __struct = Self::default();
11179 __struct.breach_time = buf.get_u32_le();
11180 __struct.breach_count = buf.get_u16_le();
11181 __struct.breach_status = buf.get_u8();
11182 let tmp = buf.get_u8();
11183 __struct.breach_type =
11184 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11185 enum_type: "FenceBreach",
11186 value: tmp as u32,
11187 })?;
11188 let tmp = buf.get_u8();
11189 __struct.breach_mitigation =
11190 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11191 enum_type: "FenceMitigate",
11192 value: tmp as u32,
11193 })?;
11194 Ok(__struct)
11195 }
11196 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11197 let mut __tmp = BytesMut::new(bytes);
11198 #[allow(clippy::absurd_extreme_comparisons)]
11199 #[allow(unused_comparisons)]
11200 if __tmp.remaining() < Self::ENCODED_LEN {
11201 panic!(
11202 "buffer is too small (need {} bytes, but got {})",
11203 Self::ENCODED_LEN,
11204 __tmp.remaining(),
11205 )
11206 }
11207 __tmp.put_u32_le(self.breach_time);
11208 __tmp.put_u16_le(self.breach_count);
11209 __tmp.put_u8(self.breach_status);
11210 __tmp.put_u8(self.breach_type as u8);
11211 if matches!(version, MavlinkVersion::V2) {
11212 __tmp.put_u8(self.breach_mitigation as u8);
11213 let len = __tmp.len();
11214 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11215 } else {
11216 __tmp.len()
11217 }
11218 }
11219}
11220#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11221#[doc = ""]
11222#[doc = "ID: 110"]
11223#[derive(Debug, Clone, PartialEq)]
11224#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11225#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11226pub struct FILE_TRANSFER_PROTOCOL_DATA {
11227 #[doc = "Network ID (0 for broadcast)"]
11228 pub target_network: u8,
11229 #[doc = "System ID (0 for broadcast)"]
11230 pub target_system: u8,
11231 #[doc = "Component ID (0 for broadcast)"]
11232 pub target_component: u8,
11233 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11234 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11235 pub payload: [u8; 251],
11236}
11237impl FILE_TRANSFER_PROTOCOL_DATA {
11238 pub const ENCODED_LEN: usize = 254usize;
11239 pub const DEFAULT: Self = Self {
11240 target_network: 0_u8,
11241 target_system: 0_u8,
11242 target_component: 0_u8,
11243 payload: [0_u8; 251usize],
11244 };
11245 #[cfg(feature = "arbitrary")]
11246 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11247 use arbitrary::{Arbitrary, Unstructured};
11248 let mut buf = [0u8; 1024];
11249 rng.fill_bytes(&mut buf);
11250 let mut unstructured = Unstructured::new(&buf);
11251 Self::arbitrary(&mut unstructured).unwrap_or_default()
11252 }
11253}
11254impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11255 fn default() -> Self {
11256 Self::DEFAULT.clone()
11257 }
11258}
11259impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11260 type Message = MavMessage;
11261 const ID: u32 = 110u32;
11262 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11263 const EXTRA_CRC: u8 = 84u8;
11264 const ENCODED_LEN: usize = 254usize;
11265 fn deser(
11266 _version: MavlinkVersion,
11267 __input: &[u8],
11268 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11269 let avail_len = __input.len();
11270 let mut payload_buf = [0; Self::ENCODED_LEN];
11271 let mut buf = if avail_len < Self::ENCODED_LEN {
11272 payload_buf[0..avail_len].copy_from_slice(__input);
11273 Bytes::new(&payload_buf)
11274 } else {
11275 Bytes::new(__input)
11276 };
11277 let mut __struct = Self::default();
11278 __struct.target_network = buf.get_u8();
11279 __struct.target_system = buf.get_u8();
11280 __struct.target_component = buf.get_u8();
11281 for v in &mut __struct.payload {
11282 let val = buf.get_u8();
11283 *v = val;
11284 }
11285 Ok(__struct)
11286 }
11287 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11288 let mut __tmp = BytesMut::new(bytes);
11289 #[allow(clippy::absurd_extreme_comparisons)]
11290 #[allow(unused_comparisons)]
11291 if __tmp.remaining() < Self::ENCODED_LEN {
11292 panic!(
11293 "buffer is too small (need {} bytes, but got {})",
11294 Self::ENCODED_LEN,
11295 __tmp.remaining(),
11296 )
11297 }
11298 __tmp.put_u8(self.target_network);
11299 __tmp.put_u8(self.target_system);
11300 __tmp.put_u8(self.target_component);
11301 for val in &self.payload {
11302 __tmp.put_u8(*val);
11303 }
11304 if matches!(version, MavlinkVersion::V2) {
11305 let len = __tmp.len();
11306 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11307 } else {
11308 __tmp.len()
11309 }
11310 }
11311}
11312#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11313#[doc = ""]
11314#[doc = "ID: 264"]
11315#[derive(Debug, Clone, PartialEq)]
11316#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11317#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11318pub struct FLIGHT_INFORMATION_DATA {
11319 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11320 pub arming_time_utc: u64,
11321 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11322 pub takeoff_time_utc: u64,
11323 #[doc = "Flight number. Note, field is misnamed UUID."]
11324 pub flight_uuid: u64,
11325 #[doc = "Timestamp (time since system boot)."]
11326 pub time_boot_ms: u32,
11327 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11328 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11329 pub landing_time: u32,
11330}
11331impl FLIGHT_INFORMATION_DATA {
11332 pub const ENCODED_LEN: usize = 32usize;
11333 pub const DEFAULT: Self = Self {
11334 arming_time_utc: 0_u64,
11335 takeoff_time_utc: 0_u64,
11336 flight_uuid: 0_u64,
11337 time_boot_ms: 0_u32,
11338 landing_time: 0_u32,
11339 };
11340 #[cfg(feature = "arbitrary")]
11341 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11342 use arbitrary::{Arbitrary, Unstructured};
11343 let mut buf = [0u8; 1024];
11344 rng.fill_bytes(&mut buf);
11345 let mut unstructured = Unstructured::new(&buf);
11346 Self::arbitrary(&mut unstructured).unwrap_or_default()
11347 }
11348}
11349impl Default for FLIGHT_INFORMATION_DATA {
11350 fn default() -> Self {
11351 Self::DEFAULT.clone()
11352 }
11353}
11354impl MessageData for FLIGHT_INFORMATION_DATA {
11355 type Message = MavMessage;
11356 const ID: u32 = 264u32;
11357 const NAME: &'static str = "FLIGHT_INFORMATION";
11358 const EXTRA_CRC: u8 = 49u8;
11359 const ENCODED_LEN: usize = 32usize;
11360 fn deser(
11361 _version: MavlinkVersion,
11362 __input: &[u8],
11363 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11364 let avail_len = __input.len();
11365 let mut payload_buf = [0; Self::ENCODED_LEN];
11366 let mut buf = if avail_len < Self::ENCODED_LEN {
11367 payload_buf[0..avail_len].copy_from_slice(__input);
11368 Bytes::new(&payload_buf)
11369 } else {
11370 Bytes::new(__input)
11371 };
11372 let mut __struct = Self::default();
11373 __struct.arming_time_utc = buf.get_u64_le();
11374 __struct.takeoff_time_utc = buf.get_u64_le();
11375 __struct.flight_uuid = buf.get_u64_le();
11376 __struct.time_boot_ms = buf.get_u32_le();
11377 __struct.landing_time = buf.get_u32_le();
11378 Ok(__struct)
11379 }
11380 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11381 let mut __tmp = BytesMut::new(bytes);
11382 #[allow(clippy::absurd_extreme_comparisons)]
11383 #[allow(unused_comparisons)]
11384 if __tmp.remaining() < Self::ENCODED_LEN {
11385 panic!(
11386 "buffer is too small (need {} bytes, but got {})",
11387 Self::ENCODED_LEN,
11388 __tmp.remaining(),
11389 )
11390 }
11391 __tmp.put_u64_le(self.arming_time_utc);
11392 __tmp.put_u64_le(self.takeoff_time_utc);
11393 __tmp.put_u64_le(self.flight_uuid);
11394 __tmp.put_u32_le(self.time_boot_ms);
11395 if matches!(version, MavlinkVersion::V2) {
11396 __tmp.put_u32_le(self.landing_time);
11397 let len = __tmp.len();
11398 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11399 } else {
11400 __tmp.len()
11401 }
11402 }
11403}
11404#[doc = "Current motion information from a designated system."]
11405#[doc = ""]
11406#[doc = "ID: 144"]
11407#[derive(Debug, Clone, PartialEq)]
11408#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11409#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11410pub struct FOLLOW_TARGET_DATA {
11411 #[doc = "Timestamp (time since system boot)."]
11412 pub timestamp: u64,
11413 #[doc = "button states or switches of a tracker device"]
11414 pub custom_state: u64,
11415 #[doc = "Latitude (WGS84)"]
11416 pub lat: i32,
11417 #[doc = "Longitude (WGS84)"]
11418 pub lon: i32,
11419 #[doc = "Altitude (MSL)"]
11420 pub alt: f32,
11421 #[doc = "target velocity (0,0,0) for unknown"]
11422 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11423 pub vel: [f32; 3],
11424 #[doc = "linear target acceleration (0,0,0) for unknown"]
11425 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11426 pub acc: [f32; 3],
11427 #[doc = "(0 0 0 0 for unknown)"]
11428 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11429 pub attitude_q: [f32; 4],
11430 #[doc = "(0 0 0 for unknown)"]
11431 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11432 pub rates: [f32; 3],
11433 #[doc = "eph epv"]
11434 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11435 pub position_cov: [f32; 3],
11436 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
11437 pub est_capabilities: u8,
11438}
11439impl FOLLOW_TARGET_DATA {
11440 pub const ENCODED_LEN: usize = 93usize;
11441 pub const DEFAULT: Self = Self {
11442 timestamp: 0_u64,
11443 custom_state: 0_u64,
11444 lat: 0_i32,
11445 lon: 0_i32,
11446 alt: 0.0_f32,
11447 vel: [0.0_f32; 3usize],
11448 acc: [0.0_f32; 3usize],
11449 attitude_q: [0.0_f32; 4usize],
11450 rates: [0.0_f32; 3usize],
11451 position_cov: [0.0_f32; 3usize],
11452 est_capabilities: 0_u8,
11453 };
11454 #[cfg(feature = "arbitrary")]
11455 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11456 use arbitrary::{Arbitrary, Unstructured};
11457 let mut buf = [0u8; 1024];
11458 rng.fill_bytes(&mut buf);
11459 let mut unstructured = Unstructured::new(&buf);
11460 Self::arbitrary(&mut unstructured).unwrap_or_default()
11461 }
11462}
11463impl Default for FOLLOW_TARGET_DATA {
11464 fn default() -> Self {
11465 Self::DEFAULT.clone()
11466 }
11467}
11468impl MessageData for FOLLOW_TARGET_DATA {
11469 type Message = MavMessage;
11470 const ID: u32 = 144u32;
11471 const NAME: &'static str = "FOLLOW_TARGET";
11472 const EXTRA_CRC: u8 = 127u8;
11473 const ENCODED_LEN: usize = 93usize;
11474 fn deser(
11475 _version: MavlinkVersion,
11476 __input: &[u8],
11477 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11478 let avail_len = __input.len();
11479 let mut payload_buf = [0; Self::ENCODED_LEN];
11480 let mut buf = if avail_len < Self::ENCODED_LEN {
11481 payload_buf[0..avail_len].copy_from_slice(__input);
11482 Bytes::new(&payload_buf)
11483 } else {
11484 Bytes::new(__input)
11485 };
11486 let mut __struct = Self::default();
11487 __struct.timestamp = buf.get_u64_le();
11488 __struct.custom_state = buf.get_u64_le();
11489 __struct.lat = buf.get_i32_le();
11490 __struct.lon = buf.get_i32_le();
11491 __struct.alt = buf.get_f32_le();
11492 for v in &mut __struct.vel {
11493 let val = buf.get_f32_le();
11494 *v = val;
11495 }
11496 for v in &mut __struct.acc {
11497 let val = buf.get_f32_le();
11498 *v = val;
11499 }
11500 for v in &mut __struct.attitude_q {
11501 let val = buf.get_f32_le();
11502 *v = val;
11503 }
11504 for v in &mut __struct.rates {
11505 let val = buf.get_f32_le();
11506 *v = val;
11507 }
11508 for v in &mut __struct.position_cov {
11509 let val = buf.get_f32_le();
11510 *v = val;
11511 }
11512 __struct.est_capabilities = buf.get_u8();
11513 Ok(__struct)
11514 }
11515 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11516 let mut __tmp = BytesMut::new(bytes);
11517 #[allow(clippy::absurd_extreme_comparisons)]
11518 #[allow(unused_comparisons)]
11519 if __tmp.remaining() < Self::ENCODED_LEN {
11520 panic!(
11521 "buffer is too small (need {} bytes, but got {})",
11522 Self::ENCODED_LEN,
11523 __tmp.remaining(),
11524 )
11525 }
11526 __tmp.put_u64_le(self.timestamp);
11527 __tmp.put_u64_le(self.custom_state);
11528 __tmp.put_i32_le(self.lat);
11529 __tmp.put_i32_le(self.lon);
11530 __tmp.put_f32_le(self.alt);
11531 for val in &self.vel {
11532 __tmp.put_f32_le(*val);
11533 }
11534 for val in &self.acc {
11535 __tmp.put_f32_le(*val);
11536 }
11537 for val in &self.attitude_q {
11538 __tmp.put_f32_le(*val);
11539 }
11540 for val in &self.rates {
11541 __tmp.put_f32_le(*val);
11542 }
11543 for val in &self.position_cov {
11544 __tmp.put_f32_le(*val);
11545 }
11546 __tmp.put_u8(self.est_capabilities);
11547 if matches!(version, MavlinkVersion::V2) {
11548 let len = __tmp.len();
11549 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11550 } else {
11551 __tmp.len()
11552 }
11553 }
11554}
11555#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
11556#[doc = ""]
11557#[doc = "ID: 371"]
11558#[derive(Debug, Clone, PartialEq)]
11559#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11561pub struct FUEL_STATUS_DATA {
11562 #[doc = "Capacity when full. Must be provided."]
11563 pub maximum_fuel: f32,
11564 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11565 pub consumed_fuel: f32,
11566 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11567 pub remaining_fuel: f32,
11568 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
11569 pub flow_rate: f32,
11570 #[doc = "Fuel temperature. NaN: field not provided."]
11571 pub temperature: f32,
11572 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
11573 pub fuel_type: MavFuelType,
11574 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
11575 pub id: u8,
11576 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
11577 pub percent_remaining: u8,
11578}
11579impl FUEL_STATUS_DATA {
11580 pub const ENCODED_LEN: usize = 26usize;
11581 pub const DEFAULT: Self = Self {
11582 maximum_fuel: 0.0_f32,
11583 consumed_fuel: 0.0_f32,
11584 remaining_fuel: 0.0_f32,
11585 flow_rate: 0.0_f32,
11586 temperature: 0.0_f32,
11587 fuel_type: MavFuelType::DEFAULT,
11588 id: 0_u8,
11589 percent_remaining: 0_u8,
11590 };
11591 #[cfg(feature = "arbitrary")]
11592 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11593 use arbitrary::{Arbitrary, Unstructured};
11594 let mut buf = [0u8; 1024];
11595 rng.fill_bytes(&mut buf);
11596 let mut unstructured = Unstructured::new(&buf);
11597 Self::arbitrary(&mut unstructured).unwrap_or_default()
11598 }
11599}
11600impl Default for FUEL_STATUS_DATA {
11601 fn default() -> Self {
11602 Self::DEFAULT.clone()
11603 }
11604}
11605impl MessageData for FUEL_STATUS_DATA {
11606 type Message = MavMessage;
11607 const ID: u32 = 371u32;
11608 const NAME: &'static str = "FUEL_STATUS";
11609 const EXTRA_CRC: u8 = 10u8;
11610 const ENCODED_LEN: usize = 26usize;
11611 fn deser(
11612 _version: MavlinkVersion,
11613 __input: &[u8],
11614 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11615 let avail_len = __input.len();
11616 let mut payload_buf = [0; Self::ENCODED_LEN];
11617 let mut buf = if avail_len < Self::ENCODED_LEN {
11618 payload_buf[0..avail_len].copy_from_slice(__input);
11619 Bytes::new(&payload_buf)
11620 } else {
11621 Bytes::new(__input)
11622 };
11623 let mut __struct = Self::default();
11624 __struct.maximum_fuel = buf.get_f32_le();
11625 __struct.consumed_fuel = buf.get_f32_le();
11626 __struct.remaining_fuel = buf.get_f32_le();
11627 __struct.flow_rate = buf.get_f32_le();
11628 __struct.temperature = buf.get_f32_le();
11629 let tmp = buf.get_u32_le();
11630 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
11631 ::mavlink_core::error::ParserError::InvalidEnum {
11632 enum_type: "MavFuelType",
11633 value: tmp as u32,
11634 },
11635 )?;
11636 __struct.id = buf.get_u8();
11637 __struct.percent_remaining = buf.get_u8();
11638 Ok(__struct)
11639 }
11640 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11641 let mut __tmp = BytesMut::new(bytes);
11642 #[allow(clippy::absurd_extreme_comparisons)]
11643 #[allow(unused_comparisons)]
11644 if __tmp.remaining() < Self::ENCODED_LEN {
11645 panic!(
11646 "buffer is too small (need {} bytes, but got {})",
11647 Self::ENCODED_LEN,
11648 __tmp.remaining(),
11649 )
11650 }
11651 __tmp.put_f32_le(self.maximum_fuel);
11652 __tmp.put_f32_le(self.consumed_fuel);
11653 __tmp.put_f32_le(self.remaining_fuel);
11654 __tmp.put_f32_le(self.flow_rate);
11655 __tmp.put_f32_le(self.temperature);
11656 __tmp.put_u32_le(self.fuel_type as u32);
11657 __tmp.put_u8(self.id);
11658 __tmp.put_u8(self.percent_remaining);
11659 if matches!(version, MavlinkVersion::V2) {
11660 let len = __tmp.len();
11661 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11662 } else {
11663 __tmp.len()
11664 }
11665 }
11666}
11667#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
11668#[doc = ""]
11669#[doc = "ID: 373"]
11670#[derive(Debug, Clone, PartialEq)]
11671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11672#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11673pub struct GENERATOR_STATUS_DATA {
11674 #[doc = "Status flags."]
11675 pub status: MavGeneratorStatusFlag,
11676 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
11677 pub battery_current: f32,
11678 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
11679 pub load_current: f32,
11680 #[doc = "The power being generated. NaN: field not provided"]
11681 pub power_generated: f32,
11682 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
11683 pub bus_voltage: f32,
11684 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
11685 pub bat_current_setpoint: f32,
11686 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
11687 pub runtime: u32,
11688 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
11689 pub time_until_maintenance: i32,
11690 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
11691 pub generator_speed: u16,
11692 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
11693 pub rectifier_temperature: i16,
11694 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
11695 pub generator_temperature: i16,
11696}
11697impl GENERATOR_STATUS_DATA {
11698 pub const ENCODED_LEN: usize = 42usize;
11699 pub const DEFAULT: Self = Self {
11700 status: MavGeneratorStatusFlag::DEFAULT,
11701 battery_current: 0.0_f32,
11702 load_current: 0.0_f32,
11703 power_generated: 0.0_f32,
11704 bus_voltage: 0.0_f32,
11705 bat_current_setpoint: 0.0_f32,
11706 runtime: 0_u32,
11707 time_until_maintenance: 0_i32,
11708 generator_speed: 0_u16,
11709 rectifier_temperature: 0_i16,
11710 generator_temperature: 0_i16,
11711 };
11712 #[cfg(feature = "arbitrary")]
11713 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11714 use arbitrary::{Arbitrary, Unstructured};
11715 let mut buf = [0u8; 1024];
11716 rng.fill_bytes(&mut buf);
11717 let mut unstructured = Unstructured::new(&buf);
11718 Self::arbitrary(&mut unstructured).unwrap_or_default()
11719 }
11720}
11721impl Default for GENERATOR_STATUS_DATA {
11722 fn default() -> Self {
11723 Self::DEFAULT.clone()
11724 }
11725}
11726impl MessageData for GENERATOR_STATUS_DATA {
11727 type Message = MavMessage;
11728 const ID: u32 = 373u32;
11729 const NAME: &'static str = "GENERATOR_STATUS";
11730 const EXTRA_CRC: u8 = 117u8;
11731 const ENCODED_LEN: usize = 42usize;
11732 fn deser(
11733 _version: MavlinkVersion,
11734 __input: &[u8],
11735 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11736 let avail_len = __input.len();
11737 let mut payload_buf = [0; Self::ENCODED_LEN];
11738 let mut buf = if avail_len < Self::ENCODED_LEN {
11739 payload_buf[0..avail_len].copy_from_slice(__input);
11740 Bytes::new(&payload_buf)
11741 } else {
11742 Bytes::new(__input)
11743 };
11744 let mut __struct = Self::default();
11745 let tmp = buf.get_u64_le();
11746 __struct.status = MavGeneratorStatusFlag::from_bits(
11747 tmp & MavGeneratorStatusFlag::all().bits(),
11748 )
11749 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11750 flag_type: "MavGeneratorStatusFlag",
11751 value: tmp as u32,
11752 })?;
11753 __struct.battery_current = buf.get_f32_le();
11754 __struct.load_current = buf.get_f32_le();
11755 __struct.power_generated = buf.get_f32_le();
11756 __struct.bus_voltage = buf.get_f32_le();
11757 __struct.bat_current_setpoint = buf.get_f32_le();
11758 __struct.runtime = buf.get_u32_le();
11759 __struct.time_until_maintenance = buf.get_i32_le();
11760 __struct.generator_speed = buf.get_u16_le();
11761 __struct.rectifier_temperature = buf.get_i16_le();
11762 __struct.generator_temperature = buf.get_i16_le();
11763 Ok(__struct)
11764 }
11765 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11766 let mut __tmp = BytesMut::new(bytes);
11767 #[allow(clippy::absurd_extreme_comparisons)]
11768 #[allow(unused_comparisons)]
11769 if __tmp.remaining() < Self::ENCODED_LEN {
11770 panic!(
11771 "buffer is too small (need {} bytes, but got {})",
11772 Self::ENCODED_LEN,
11773 __tmp.remaining(),
11774 )
11775 }
11776 __tmp.put_u64_le(self.status.bits());
11777 __tmp.put_f32_le(self.battery_current);
11778 __tmp.put_f32_le(self.load_current);
11779 __tmp.put_f32_le(self.power_generated);
11780 __tmp.put_f32_le(self.bus_voltage);
11781 __tmp.put_f32_le(self.bat_current_setpoint);
11782 __tmp.put_u32_le(self.runtime);
11783 __tmp.put_i32_le(self.time_until_maintenance);
11784 __tmp.put_u16_le(self.generator_speed);
11785 __tmp.put_i16_le(self.rectifier_temperature);
11786 __tmp.put_i16_le(self.generator_temperature);
11787 if matches!(version, MavlinkVersion::V2) {
11788 let len = __tmp.len();
11789 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11790 } else {
11791 __tmp.len()
11792 }
11793 }
11794}
11795#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
11796#[doc = ""]
11797#[doc = "ID: 285"]
11798#[derive(Debug, Clone, PartialEq)]
11799#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11800#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11801pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11802 #[doc = "Timestamp (time since system boot)."]
11803 pub time_boot_ms: u32,
11804 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
11805 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11806 pub q: [f32; 4],
11807 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
11808 pub angular_velocity_x: f32,
11809 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
11810 pub angular_velocity_y: f32,
11811 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
11812 pub angular_velocity_z: f32,
11813 #[doc = "Failure flags (0 for no failure)"]
11814 pub failure_flags: GimbalDeviceErrorFlags,
11815 #[doc = "Current gimbal flags set."]
11816 pub flags: GimbalDeviceFlags,
11817 #[doc = "System ID"]
11818 pub target_system: u8,
11819 #[doc = "Component ID"]
11820 pub target_component: u8,
11821 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
11822 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11823 pub delta_yaw: f32,
11824 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
11825 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11826 pub delta_yaw_velocity: f32,
11827 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
11828 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11829 pub gimbal_device_id: u8,
11830}
11831impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11832 pub const ENCODED_LEN: usize = 49usize;
11833 pub const DEFAULT: Self = Self {
11834 time_boot_ms: 0_u32,
11835 q: [0.0_f32; 4usize],
11836 angular_velocity_x: 0.0_f32,
11837 angular_velocity_y: 0.0_f32,
11838 angular_velocity_z: 0.0_f32,
11839 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
11840 flags: GimbalDeviceFlags::DEFAULT,
11841 target_system: 0_u8,
11842 target_component: 0_u8,
11843 delta_yaw: 0.0_f32,
11844 delta_yaw_velocity: 0.0_f32,
11845 gimbal_device_id: 0_u8,
11846 };
11847 #[cfg(feature = "arbitrary")]
11848 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11849 use arbitrary::{Arbitrary, Unstructured};
11850 let mut buf = [0u8; 1024];
11851 rng.fill_bytes(&mut buf);
11852 let mut unstructured = Unstructured::new(&buf);
11853 Self::arbitrary(&mut unstructured).unwrap_or_default()
11854 }
11855}
11856impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11857 fn default() -> Self {
11858 Self::DEFAULT.clone()
11859 }
11860}
11861impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11862 type Message = MavMessage;
11863 const ID: u32 = 285u32;
11864 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
11865 const EXTRA_CRC: u8 = 137u8;
11866 const ENCODED_LEN: usize = 49usize;
11867 fn deser(
11868 _version: MavlinkVersion,
11869 __input: &[u8],
11870 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11871 let avail_len = __input.len();
11872 let mut payload_buf = [0; Self::ENCODED_LEN];
11873 let mut buf = if avail_len < Self::ENCODED_LEN {
11874 payload_buf[0..avail_len].copy_from_slice(__input);
11875 Bytes::new(&payload_buf)
11876 } else {
11877 Bytes::new(__input)
11878 };
11879 let mut __struct = Self::default();
11880 __struct.time_boot_ms = buf.get_u32_le();
11881 for v in &mut __struct.q {
11882 let val = buf.get_f32_le();
11883 *v = val;
11884 }
11885 __struct.angular_velocity_x = buf.get_f32_le();
11886 __struct.angular_velocity_y = buf.get_f32_le();
11887 __struct.angular_velocity_z = buf.get_f32_le();
11888 let tmp = buf.get_u32_le();
11889 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
11890 tmp & GimbalDeviceErrorFlags::all().bits(),
11891 )
11892 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11893 flag_type: "GimbalDeviceErrorFlags",
11894 value: tmp as u32,
11895 })?;
11896 let tmp = buf.get_u16_le();
11897 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
11898 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11899 flag_type: "GimbalDeviceFlags",
11900 value: tmp as u32,
11901 })?;
11902 __struct.target_system = buf.get_u8();
11903 __struct.target_component = buf.get_u8();
11904 __struct.delta_yaw = buf.get_f32_le();
11905 __struct.delta_yaw_velocity = buf.get_f32_le();
11906 __struct.gimbal_device_id = buf.get_u8();
11907 Ok(__struct)
11908 }
11909 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11910 let mut __tmp = BytesMut::new(bytes);
11911 #[allow(clippy::absurd_extreme_comparisons)]
11912 #[allow(unused_comparisons)]
11913 if __tmp.remaining() < Self::ENCODED_LEN {
11914 panic!(
11915 "buffer is too small (need {} bytes, but got {})",
11916 Self::ENCODED_LEN,
11917 __tmp.remaining(),
11918 )
11919 }
11920 __tmp.put_u32_le(self.time_boot_ms);
11921 for val in &self.q {
11922 __tmp.put_f32_le(*val);
11923 }
11924 __tmp.put_f32_le(self.angular_velocity_x);
11925 __tmp.put_f32_le(self.angular_velocity_y);
11926 __tmp.put_f32_le(self.angular_velocity_z);
11927 __tmp.put_u32_le(self.failure_flags.bits());
11928 __tmp.put_u16_le(self.flags.bits());
11929 __tmp.put_u8(self.target_system);
11930 __tmp.put_u8(self.target_component);
11931 if matches!(version, MavlinkVersion::V2) {
11932 __tmp.put_f32_le(self.delta_yaw);
11933 __tmp.put_f32_le(self.delta_yaw_velocity);
11934 __tmp.put_u8(self.gimbal_device_id);
11935 let len = __tmp.len();
11936 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11937 } else {
11938 __tmp.len()
11939 }
11940 }
11941}
11942#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
11943#[doc = ""]
11944#[doc = "ID: 283"]
11945#[derive(Debug, Clone, PartialEq)]
11946#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11947#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11948pub struct GIMBAL_DEVICE_INFORMATION_DATA {
11949 #[doc = "UID of gimbal hardware (0 if unknown)."]
11950 pub uid: u64,
11951 #[doc = "Timestamp (time since system boot)."]
11952 pub time_boot_ms: u32,
11953 #[doc = "0xff)."]
11954 pub firmware_version: u32,
11955 #[doc = "0xff)."]
11956 pub hardware_version: u32,
11957 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
11958 pub roll_min: f32,
11959 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
11960 pub roll_max: f32,
11961 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
11962 pub pitch_min: f32,
11963 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
11964 pub pitch_max: f32,
11965 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
11966 pub yaw_min: f32,
11967 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
11968 pub yaw_max: f32,
11969 #[doc = "Bitmap of gimbal capability flags."]
11970 pub cap_flags: GimbalDeviceCapFlags,
11971 #[doc = "Bitmap for use for gimbal-specific capability flags."]
11972 pub custom_cap_flags: u16,
11973 #[doc = "Name of the gimbal vendor."]
11974 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11975 pub vendor_name: [u8; 32],
11976 #[doc = "Name of the gimbal model."]
11977 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11978 pub model_name: [u8; 32],
11979 #[doc = "Custom name of the gimbal given to it by the user."]
11980 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11981 pub custom_name: [u8; 32],
11982 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
11983 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11984 pub gimbal_device_id: u8,
11985}
11986impl GIMBAL_DEVICE_INFORMATION_DATA {
11987 pub const ENCODED_LEN: usize = 145usize;
11988 pub const DEFAULT: Self = Self {
11989 uid: 0_u64,
11990 time_boot_ms: 0_u32,
11991 firmware_version: 0_u32,
11992 hardware_version: 0_u32,
11993 roll_min: 0.0_f32,
11994 roll_max: 0.0_f32,
11995 pitch_min: 0.0_f32,
11996 pitch_max: 0.0_f32,
11997 yaw_min: 0.0_f32,
11998 yaw_max: 0.0_f32,
11999 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12000 custom_cap_flags: 0_u16,
12001 vendor_name: [0_u8; 32usize],
12002 model_name: [0_u8; 32usize],
12003 custom_name: [0_u8; 32usize],
12004 gimbal_device_id: 0_u8,
12005 };
12006 #[cfg(feature = "arbitrary")]
12007 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12008 use arbitrary::{Arbitrary, Unstructured};
12009 let mut buf = [0u8; 1024];
12010 rng.fill_bytes(&mut buf);
12011 let mut unstructured = Unstructured::new(&buf);
12012 Self::arbitrary(&mut unstructured).unwrap_or_default()
12013 }
12014}
12015impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12016 fn default() -> Self {
12017 Self::DEFAULT.clone()
12018 }
12019}
12020impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12021 type Message = MavMessage;
12022 const ID: u32 = 283u32;
12023 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12024 const EXTRA_CRC: u8 = 74u8;
12025 const ENCODED_LEN: usize = 145usize;
12026 fn deser(
12027 _version: MavlinkVersion,
12028 __input: &[u8],
12029 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12030 let avail_len = __input.len();
12031 let mut payload_buf = [0; Self::ENCODED_LEN];
12032 let mut buf = if avail_len < Self::ENCODED_LEN {
12033 payload_buf[0..avail_len].copy_from_slice(__input);
12034 Bytes::new(&payload_buf)
12035 } else {
12036 Bytes::new(__input)
12037 };
12038 let mut __struct = Self::default();
12039 __struct.uid = buf.get_u64_le();
12040 __struct.time_boot_ms = buf.get_u32_le();
12041 __struct.firmware_version = buf.get_u32_le();
12042 __struct.hardware_version = buf.get_u32_le();
12043 __struct.roll_min = buf.get_f32_le();
12044 __struct.roll_max = buf.get_f32_le();
12045 __struct.pitch_min = buf.get_f32_le();
12046 __struct.pitch_max = buf.get_f32_le();
12047 __struct.yaw_min = buf.get_f32_le();
12048 __struct.yaw_max = buf.get_f32_le();
12049 let tmp = buf.get_u16_le();
12050 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
12051 tmp & GimbalDeviceCapFlags::all().bits(),
12052 )
12053 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12054 flag_type: "GimbalDeviceCapFlags",
12055 value: tmp as u32,
12056 })?;
12057 __struct.custom_cap_flags = buf.get_u16_le();
12058 for v in &mut __struct.vendor_name {
12059 let val = buf.get_u8();
12060 *v = val;
12061 }
12062 for v in &mut __struct.model_name {
12063 let val = buf.get_u8();
12064 *v = val;
12065 }
12066 for v in &mut __struct.custom_name {
12067 let val = buf.get_u8();
12068 *v = val;
12069 }
12070 __struct.gimbal_device_id = buf.get_u8();
12071 Ok(__struct)
12072 }
12073 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12074 let mut __tmp = BytesMut::new(bytes);
12075 #[allow(clippy::absurd_extreme_comparisons)]
12076 #[allow(unused_comparisons)]
12077 if __tmp.remaining() < Self::ENCODED_LEN {
12078 panic!(
12079 "buffer is too small (need {} bytes, but got {})",
12080 Self::ENCODED_LEN,
12081 __tmp.remaining(),
12082 )
12083 }
12084 __tmp.put_u64_le(self.uid);
12085 __tmp.put_u32_le(self.time_boot_ms);
12086 __tmp.put_u32_le(self.firmware_version);
12087 __tmp.put_u32_le(self.hardware_version);
12088 __tmp.put_f32_le(self.roll_min);
12089 __tmp.put_f32_le(self.roll_max);
12090 __tmp.put_f32_le(self.pitch_min);
12091 __tmp.put_f32_le(self.pitch_max);
12092 __tmp.put_f32_le(self.yaw_min);
12093 __tmp.put_f32_le(self.yaw_max);
12094 __tmp.put_u16_le(self.cap_flags.bits());
12095 __tmp.put_u16_le(self.custom_cap_flags);
12096 for val in &self.vendor_name {
12097 __tmp.put_u8(*val);
12098 }
12099 for val in &self.model_name {
12100 __tmp.put_u8(*val);
12101 }
12102 for val in &self.custom_name {
12103 __tmp.put_u8(*val);
12104 }
12105 if matches!(version, MavlinkVersion::V2) {
12106 __tmp.put_u8(self.gimbal_device_id);
12107 let len = __tmp.len();
12108 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12109 } else {
12110 __tmp.len()
12111 }
12112 }
12113}
12114#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12115#[doc = ""]
12116#[doc = "ID: 284"]
12117#[derive(Debug, Clone, PartialEq)]
12118#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12119#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12120pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12121 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12122 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12123 pub q: [f32; 4],
12124 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12125 pub angular_velocity_x: f32,
12126 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12127 pub angular_velocity_y: f32,
12128 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12129 pub angular_velocity_z: f32,
12130 #[doc = "Low level gimbal flags."]
12131 pub flags: GimbalDeviceFlags,
12132 #[doc = "System ID"]
12133 pub target_system: u8,
12134 #[doc = "Component ID"]
12135 pub target_component: u8,
12136}
12137impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12138 pub const ENCODED_LEN: usize = 32usize;
12139 pub const DEFAULT: Self = Self {
12140 q: [0.0_f32; 4usize],
12141 angular_velocity_x: 0.0_f32,
12142 angular_velocity_y: 0.0_f32,
12143 angular_velocity_z: 0.0_f32,
12144 flags: GimbalDeviceFlags::DEFAULT,
12145 target_system: 0_u8,
12146 target_component: 0_u8,
12147 };
12148 #[cfg(feature = "arbitrary")]
12149 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12150 use arbitrary::{Arbitrary, Unstructured};
12151 let mut buf = [0u8; 1024];
12152 rng.fill_bytes(&mut buf);
12153 let mut unstructured = Unstructured::new(&buf);
12154 Self::arbitrary(&mut unstructured).unwrap_or_default()
12155 }
12156}
12157impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12158 fn default() -> Self {
12159 Self::DEFAULT.clone()
12160 }
12161}
12162impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12163 type Message = MavMessage;
12164 const ID: u32 = 284u32;
12165 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12166 const EXTRA_CRC: u8 = 99u8;
12167 const ENCODED_LEN: usize = 32usize;
12168 fn deser(
12169 _version: MavlinkVersion,
12170 __input: &[u8],
12171 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12172 let avail_len = __input.len();
12173 let mut payload_buf = [0; Self::ENCODED_LEN];
12174 let mut buf = if avail_len < Self::ENCODED_LEN {
12175 payload_buf[0..avail_len].copy_from_slice(__input);
12176 Bytes::new(&payload_buf)
12177 } else {
12178 Bytes::new(__input)
12179 };
12180 let mut __struct = Self::default();
12181 for v in &mut __struct.q {
12182 let val = buf.get_f32_le();
12183 *v = val;
12184 }
12185 __struct.angular_velocity_x = buf.get_f32_le();
12186 __struct.angular_velocity_y = buf.get_f32_le();
12187 __struct.angular_velocity_z = buf.get_f32_le();
12188 let tmp = buf.get_u16_le();
12189 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12190 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12191 flag_type: "GimbalDeviceFlags",
12192 value: tmp as u32,
12193 })?;
12194 __struct.target_system = buf.get_u8();
12195 __struct.target_component = buf.get_u8();
12196 Ok(__struct)
12197 }
12198 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12199 let mut __tmp = BytesMut::new(bytes);
12200 #[allow(clippy::absurd_extreme_comparisons)]
12201 #[allow(unused_comparisons)]
12202 if __tmp.remaining() < Self::ENCODED_LEN {
12203 panic!(
12204 "buffer is too small (need {} bytes, but got {})",
12205 Self::ENCODED_LEN,
12206 __tmp.remaining(),
12207 )
12208 }
12209 for val in &self.q {
12210 __tmp.put_f32_le(*val);
12211 }
12212 __tmp.put_f32_le(self.angular_velocity_x);
12213 __tmp.put_f32_le(self.angular_velocity_y);
12214 __tmp.put_f32_le(self.angular_velocity_z);
12215 __tmp.put_u16_le(self.flags.bits());
12216 __tmp.put_u8(self.target_system);
12217 __tmp.put_u8(self.target_component);
12218 if matches!(version, MavlinkVersion::V2) {
12219 let len = __tmp.len();
12220 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12221 } else {
12222 __tmp.len()
12223 }
12224 }
12225}
12226#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12227#[doc = ""]
12228#[doc = "ID: 280"]
12229#[derive(Debug, Clone, PartialEq)]
12230#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12231#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12232pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12233 #[doc = "Timestamp (time since system boot)."]
12234 pub time_boot_ms: u32,
12235 #[doc = "Bitmap of gimbal capability flags."]
12236 pub cap_flags: GimbalManagerCapFlags,
12237 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12238 pub roll_min: f32,
12239 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12240 pub roll_max: f32,
12241 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12242 pub pitch_min: f32,
12243 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12244 pub pitch_max: f32,
12245 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12246 pub yaw_min: f32,
12247 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12248 pub yaw_max: f32,
12249 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12250 pub gimbal_device_id: u8,
12251}
12252impl GIMBAL_MANAGER_INFORMATION_DATA {
12253 pub const ENCODED_LEN: usize = 33usize;
12254 pub const DEFAULT: Self = Self {
12255 time_boot_ms: 0_u32,
12256 cap_flags: GimbalManagerCapFlags::DEFAULT,
12257 roll_min: 0.0_f32,
12258 roll_max: 0.0_f32,
12259 pitch_min: 0.0_f32,
12260 pitch_max: 0.0_f32,
12261 yaw_min: 0.0_f32,
12262 yaw_max: 0.0_f32,
12263 gimbal_device_id: 0_u8,
12264 };
12265 #[cfg(feature = "arbitrary")]
12266 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12267 use arbitrary::{Arbitrary, Unstructured};
12268 let mut buf = [0u8; 1024];
12269 rng.fill_bytes(&mut buf);
12270 let mut unstructured = Unstructured::new(&buf);
12271 Self::arbitrary(&mut unstructured).unwrap_or_default()
12272 }
12273}
12274impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12275 fn default() -> Self {
12276 Self::DEFAULT.clone()
12277 }
12278}
12279impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12280 type Message = MavMessage;
12281 const ID: u32 = 280u32;
12282 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12283 const EXTRA_CRC: u8 = 70u8;
12284 const ENCODED_LEN: usize = 33usize;
12285 fn deser(
12286 _version: MavlinkVersion,
12287 __input: &[u8],
12288 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12289 let avail_len = __input.len();
12290 let mut payload_buf = [0; Self::ENCODED_LEN];
12291 let mut buf = if avail_len < Self::ENCODED_LEN {
12292 payload_buf[0..avail_len].copy_from_slice(__input);
12293 Bytes::new(&payload_buf)
12294 } else {
12295 Bytes::new(__input)
12296 };
12297 let mut __struct = Self::default();
12298 __struct.time_boot_ms = buf.get_u32_le();
12299 let tmp = buf.get_u32_le();
12300 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12301 tmp & GimbalManagerCapFlags::all().bits(),
12302 )
12303 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12304 flag_type: "GimbalManagerCapFlags",
12305 value: tmp as u32,
12306 })?;
12307 __struct.roll_min = buf.get_f32_le();
12308 __struct.roll_max = buf.get_f32_le();
12309 __struct.pitch_min = buf.get_f32_le();
12310 __struct.pitch_max = buf.get_f32_le();
12311 __struct.yaw_min = buf.get_f32_le();
12312 __struct.yaw_max = buf.get_f32_le();
12313 __struct.gimbal_device_id = buf.get_u8();
12314 Ok(__struct)
12315 }
12316 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12317 let mut __tmp = BytesMut::new(bytes);
12318 #[allow(clippy::absurd_extreme_comparisons)]
12319 #[allow(unused_comparisons)]
12320 if __tmp.remaining() < Self::ENCODED_LEN {
12321 panic!(
12322 "buffer is too small (need {} bytes, but got {})",
12323 Self::ENCODED_LEN,
12324 __tmp.remaining(),
12325 )
12326 }
12327 __tmp.put_u32_le(self.time_boot_ms);
12328 __tmp.put_u32_le(self.cap_flags.bits());
12329 __tmp.put_f32_le(self.roll_min);
12330 __tmp.put_f32_le(self.roll_max);
12331 __tmp.put_f32_le(self.pitch_min);
12332 __tmp.put_f32_le(self.pitch_max);
12333 __tmp.put_f32_le(self.yaw_min);
12334 __tmp.put_f32_le(self.yaw_max);
12335 __tmp.put_u8(self.gimbal_device_id);
12336 if matches!(version, MavlinkVersion::V2) {
12337 let len = __tmp.len();
12338 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12339 } else {
12340 __tmp.len()
12341 }
12342 }
12343}
12344#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12345#[doc = ""]
12346#[doc = "ID: 282"]
12347#[derive(Debug, Clone, PartialEq)]
12348#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12349#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12350pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12351 #[doc = "High level gimbal manager flags to use."]
12352 pub flags: GimbalManagerFlags,
12353 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
12354 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12355 pub q: [f32; 4],
12356 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
12357 pub angular_velocity_x: f32,
12358 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
12359 pub angular_velocity_y: f32,
12360 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
12361 pub angular_velocity_z: f32,
12362 #[doc = "System ID"]
12363 pub target_system: u8,
12364 #[doc = "Component ID"]
12365 pub target_component: u8,
12366 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12367 pub gimbal_device_id: u8,
12368}
12369impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12370 pub const ENCODED_LEN: usize = 35usize;
12371 pub const DEFAULT: Self = Self {
12372 flags: GimbalManagerFlags::DEFAULT,
12373 q: [0.0_f32; 4usize],
12374 angular_velocity_x: 0.0_f32,
12375 angular_velocity_y: 0.0_f32,
12376 angular_velocity_z: 0.0_f32,
12377 target_system: 0_u8,
12378 target_component: 0_u8,
12379 gimbal_device_id: 0_u8,
12380 };
12381 #[cfg(feature = "arbitrary")]
12382 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12383 use arbitrary::{Arbitrary, Unstructured};
12384 let mut buf = [0u8; 1024];
12385 rng.fill_bytes(&mut buf);
12386 let mut unstructured = Unstructured::new(&buf);
12387 Self::arbitrary(&mut unstructured).unwrap_or_default()
12388 }
12389}
12390impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12391 fn default() -> Self {
12392 Self::DEFAULT.clone()
12393 }
12394}
12395impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12396 type Message = MavMessage;
12397 const ID: u32 = 282u32;
12398 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
12399 const EXTRA_CRC: u8 = 123u8;
12400 const ENCODED_LEN: usize = 35usize;
12401 fn deser(
12402 _version: MavlinkVersion,
12403 __input: &[u8],
12404 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12405 let avail_len = __input.len();
12406 let mut payload_buf = [0; Self::ENCODED_LEN];
12407 let mut buf = if avail_len < Self::ENCODED_LEN {
12408 payload_buf[0..avail_len].copy_from_slice(__input);
12409 Bytes::new(&payload_buf)
12410 } else {
12411 Bytes::new(__input)
12412 };
12413 let mut __struct = Self::default();
12414 let tmp = buf.get_u32_le();
12415 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12416 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12417 flag_type: "GimbalManagerFlags",
12418 value: tmp as u32,
12419 })?;
12420 for v in &mut __struct.q {
12421 let val = buf.get_f32_le();
12422 *v = val;
12423 }
12424 __struct.angular_velocity_x = buf.get_f32_le();
12425 __struct.angular_velocity_y = buf.get_f32_le();
12426 __struct.angular_velocity_z = buf.get_f32_le();
12427 __struct.target_system = buf.get_u8();
12428 __struct.target_component = buf.get_u8();
12429 __struct.gimbal_device_id = buf.get_u8();
12430 Ok(__struct)
12431 }
12432 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12433 let mut __tmp = BytesMut::new(bytes);
12434 #[allow(clippy::absurd_extreme_comparisons)]
12435 #[allow(unused_comparisons)]
12436 if __tmp.remaining() < Self::ENCODED_LEN {
12437 panic!(
12438 "buffer is too small (need {} bytes, but got {})",
12439 Self::ENCODED_LEN,
12440 __tmp.remaining(),
12441 )
12442 }
12443 __tmp.put_u32_le(self.flags.bits());
12444 for val in &self.q {
12445 __tmp.put_f32_le(*val);
12446 }
12447 __tmp.put_f32_le(self.angular_velocity_x);
12448 __tmp.put_f32_le(self.angular_velocity_y);
12449 __tmp.put_f32_le(self.angular_velocity_z);
12450 __tmp.put_u8(self.target_system);
12451 __tmp.put_u8(self.target_component);
12452 __tmp.put_u8(self.gimbal_device_id);
12453 if matches!(version, MavlinkVersion::V2) {
12454 let len = __tmp.len();
12455 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12456 } else {
12457 __tmp.len()
12458 }
12459 }
12460}
12461#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12462#[doc = ""]
12463#[doc = "ID: 288"]
12464#[derive(Debug, Clone, PartialEq)]
12465#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12466#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12467pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12468 #[doc = "High level gimbal manager flags."]
12469 pub flags: GimbalManagerFlags,
12470 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12471 pub pitch: f32,
12472 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12473 pub yaw: f32,
12474 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12475 pub pitch_rate: f32,
12476 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12477 pub yaw_rate: f32,
12478 #[doc = "System ID"]
12479 pub target_system: u8,
12480 #[doc = "Component ID"]
12481 pub target_component: u8,
12482 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12483 pub gimbal_device_id: u8,
12484}
12485impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12486 pub const ENCODED_LEN: usize = 23usize;
12487 pub const DEFAULT: Self = Self {
12488 flags: GimbalManagerFlags::DEFAULT,
12489 pitch: 0.0_f32,
12490 yaw: 0.0_f32,
12491 pitch_rate: 0.0_f32,
12492 yaw_rate: 0.0_f32,
12493 target_system: 0_u8,
12494 target_component: 0_u8,
12495 gimbal_device_id: 0_u8,
12496 };
12497 #[cfg(feature = "arbitrary")]
12498 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12499 use arbitrary::{Arbitrary, Unstructured};
12500 let mut buf = [0u8; 1024];
12501 rng.fill_bytes(&mut buf);
12502 let mut unstructured = Unstructured::new(&buf);
12503 Self::arbitrary(&mut unstructured).unwrap_or_default()
12504 }
12505}
12506impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12507 fn default() -> Self {
12508 Self::DEFAULT.clone()
12509 }
12510}
12511impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12512 type Message = MavMessage;
12513 const ID: u32 = 288u32;
12514 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
12515 const EXTRA_CRC: u8 = 20u8;
12516 const ENCODED_LEN: usize = 23usize;
12517 fn deser(
12518 _version: MavlinkVersion,
12519 __input: &[u8],
12520 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12521 let avail_len = __input.len();
12522 let mut payload_buf = [0; Self::ENCODED_LEN];
12523 let mut buf = if avail_len < Self::ENCODED_LEN {
12524 payload_buf[0..avail_len].copy_from_slice(__input);
12525 Bytes::new(&payload_buf)
12526 } else {
12527 Bytes::new(__input)
12528 };
12529 let mut __struct = Self::default();
12530 let tmp = buf.get_u32_le();
12531 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12532 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12533 flag_type: "GimbalManagerFlags",
12534 value: tmp as u32,
12535 })?;
12536 __struct.pitch = buf.get_f32_le();
12537 __struct.yaw = buf.get_f32_le();
12538 __struct.pitch_rate = buf.get_f32_le();
12539 __struct.yaw_rate = buf.get_f32_le();
12540 __struct.target_system = buf.get_u8();
12541 __struct.target_component = buf.get_u8();
12542 __struct.gimbal_device_id = buf.get_u8();
12543 Ok(__struct)
12544 }
12545 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12546 let mut __tmp = BytesMut::new(bytes);
12547 #[allow(clippy::absurd_extreme_comparisons)]
12548 #[allow(unused_comparisons)]
12549 if __tmp.remaining() < Self::ENCODED_LEN {
12550 panic!(
12551 "buffer is too small (need {} bytes, but got {})",
12552 Self::ENCODED_LEN,
12553 __tmp.remaining(),
12554 )
12555 }
12556 __tmp.put_u32_le(self.flags.bits());
12557 __tmp.put_f32_le(self.pitch);
12558 __tmp.put_f32_le(self.yaw);
12559 __tmp.put_f32_le(self.pitch_rate);
12560 __tmp.put_f32_le(self.yaw_rate);
12561 __tmp.put_u8(self.target_system);
12562 __tmp.put_u8(self.target_component);
12563 __tmp.put_u8(self.gimbal_device_id);
12564 if matches!(version, MavlinkVersion::V2) {
12565 let len = __tmp.len();
12566 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12567 } else {
12568 __tmp.len()
12569 }
12570 }
12571}
12572#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
12573#[doc = ""]
12574#[doc = "ID: 287"]
12575#[derive(Debug, Clone, PartialEq)]
12576#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12577#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12578pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12579 #[doc = "High level gimbal manager flags to use."]
12580 pub flags: GimbalManagerFlags,
12581 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
12582 pub pitch: f32,
12583 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
12584 pub yaw: f32,
12585 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
12586 pub pitch_rate: f32,
12587 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
12588 pub yaw_rate: f32,
12589 #[doc = "System ID"]
12590 pub target_system: u8,
12591 #[doc = "Component ID"]
12592 pub target_component: u8,
12593 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12594 pub gimbal_device_id: u8,
12595}
12596impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12597 pub const ENCODED_LEN: usize = 23usize;
12598 pub const DEFAULT: Self = Self {
12599 flags: GimbalManagerFlags::DEFAULT,
12600 pitch: 0.0_f32,
12601 yaw: 0.0_f32,
12602 pitch_rate: 0.0_f32,
12603 yaw_rate: 0.0_f32,
12604 target_system: 0_u8,
12605 target_component: 0_u8,
12606 gimbal_device_id: 0_u8,
12607 };
12608 #[cfg(feature = "arbitrary")]
12609 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12610 use arbitrary::{Arbitrary, Unstructured};
12611 let mut buf = [0u8; 1024];
12612 rng.fill_bytes(&mut buf);
12613 let mut unstructured = Unstructured::new(&buf);
12614 Self::arbitrary(&mut unstructured).unwrap_or_default()
12615 }
12616}
12617impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12618 fn default() -> Self {
12619 Self::DEFAULT.clone()
12620 }
12621}
12622impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12623 type Message = MavMessage;
12624 const ID: u32 = 287u32;
12625 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
12626 const EXTRA_CRC: u8 = 1u8;
12627 const ENCODED_LEN: usize = 23usize;
12628 fn deser(
12629 _version: MavlinkVersion,
12630 __input: &[u8],
12631 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12632 let avail_len = __input.len();
12633 let mut payload_buf = [0; Self::ENCODED_LEN];
12634 let mut buf = if avail_len < Self::ENCODED_LEN {
12635 payload_buf[0..avail_len].copy_from_slice(__input);
12636 Bytes::new(&payload_buf)
12637 } else {
12638 Bytes::new(__input)
12639 };
12640 let mut __struct = Self::default();
12641 let tmp = buf.get_u32_le();
12642 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12643 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12644 flag_type: "GimbalManagerFlags",
12645 value: tmp as u32,
12646 })?;
12647 __struct.pitch = buf.get_f32_le();
12648 __struct.yaw = buf.get_f32_le();
12649 __struct.pitch_rate = buf.get_f32_le();
12650 __struct.yaw_rate = buf.get_f32_le();
12651 __struct.target_system = buf.get_u8();
12652 __struct.target_component = buf.get_u8();
12653 __struct.gimbal_device_id = buf.get_u8();
12654 Ok(__struct)
12655 }
12656 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12657 let mut __tmp = BytesMut::new(bytes);
12658 #[allow(clippy::absurd_extreme_comparisons)]
12659 #[allow(unused_comparisons)]
12660 if __tmp.remaining() < Self::ENCODED_LEN {
12661 panic!(
12662 "buffer is too small (need {} bytes, but got {})",
12663 Self::ENCODED_LEN,
12664 __tmp.remaining(),
12665 )
12666 }
12667 __tmp.put_u32_le(self.flags.bits());
12668 __tmp.put_f32_le(self.pitch);
12669 __tmp.put_f32_le(self.yaw);
12670 __tmp.put_f32_le(self.pitch_rate);
12671 __tmp.put_f32_le(self.yaw_rate);
12672 __tmp.put_u8(self.target_system);
12673 __tmp.put_u8(self.target_component);
12674 __tmp.put_u8(self.gimbal_device_id);
12675 if matches!(version, MavlinkVersion::V2) {
12676 let len = __tmp.len();
12677 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12678 } else {
12679 __tmp.len()
12680 }
12681 }
12682}
12683#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
12684#[doc = ""]
12685#[doc = "ID: 281"]
12686#[derive(Debug, Clone, PartialEq)]
12687#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12688#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12689pub struct GIMBAL_MANAGER_STATUS_DATA {
12690 #[doc = "Timestamp (time since system boot)."]
12691 pub time_boot_ms: u32,
12692 #[doc = "High level gimbal manager flags currently applied."]
12693 pub flags: GimbalManagerFlags,
12694 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12695 pub gimbal_device_id: u8,
12696 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
12697 pub primary_control_sysid: u8,
12698 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
12699 pub primary_control_compid: u8,
12700 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
12701 pub secondary_control_sysid: u8,
12702 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
12703 pub secondary_control_compid: u8,
12704}
12705impl GIMBAL_MANAGER_STATUS_DATA {
12706 pub const ENCODED_LEN: usize = 13usize;
12707 pub const DEFAULT: Self = Self {
12708 time_boot_ms: 0_u32,
12709 flags: GimbalManagerFlags::DEFAULT,
12710 gimbal_device_id: 0_u8,
12711 primary_control_sysid: 0_u8,
12712 primary_control_compid: 0_u8,
12713 secondary_control_sysid: 0_u8,
12714 secondary_control_compid: 0_u8,
12715 };
12716 #[cfg(feature = "arbitrary")]
12717 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12718 use arbitrary::{Arbitrary, Unstructured};
12719 let mut buf = [0u8; 1024];
12720 rng.fill_bytes(&mut buf);
12721 let mut unstructured = Unstructured::new(&buf);
12722 Self::arbitrary(&mut unstructured).unwrap_or_default()
12723 }
12724}
12725impl Default for GIMBAL_MANAGER_STATUS_DATA {
12726 fn default() -> Self {
12727 Self::DEFAULT.clone()
12728 }
12729}
12730impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
12731 type Message = MavMessage;
12732 const ID: u32 = 281u32;
12733 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
12734 const EXTRA_CRC: u8 = 48u8;
12735 const ENCODED_LEN: usize = 13usize;
12736 fn deser(
12737 _version: MavlinkVersion,
12738 __input: &[u8],
12739 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12740 let avail_len = __input.len();
12741 let mut payload_buf = [0; Self::ENCODED_LEN];
12742 let mut buf = if avail_len < Self::ENCODED_LEN {
12743 payload_buf[0..avail_len].copy_from_slice(__input);
12744 Bytes::new(&payload_buf)
12745 } else {
12746 Bytes::new(__input)
12747 };
12748 let mut __struct = Self::default();
12749 __struct.time_boot_ms = buf.get_u32_le();
12750 let tmp = buf.get_u32_le();
12751 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12752 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12753 flag_type: "GimbalManagerFlags",
12754 value: tmp as u32,
12755 })?;
12756 __struct.gimbal_device_id = buf.get_u8();
12757 __struct.primary_control_sysid = buf.get_u8();
12758 __struct.primary_control_compid = buf.get_u8();
12759 __struct.secondary_control_sysid = buf.get_u8();
12760 __struct.secondary_control_compid = buf.get_u8();
12761 Ok(__struct)
12762 }
12763 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12764 let mut __tmp = BytesMut::new(bytes);
12765 #[allow(clippy::absurd_extreme_comparisons)]
12766 #[allow(unused_comparisons)]
12767 if __tmp.remaining() < Self::ENCODED_LEN {
12768 panic!(
12769 "buffer is too small (need {} bytes, but got {})",
12770 Self::ENCODED_LEN,
12771 __tmp.remaining(),
12772 )
12773 }
12774 __tmp.put_u32_le(self.time_boot_ms);
12775 __tmp.put_u32_le(self.flags.bits());
12776 __tmp.put_u8(self.gimbal_device_id);
12777 __tmp.put_u8(self.primary_control_sysid);
12778 __tmp.put_u8(self.primary_control_compid);
12779 __tmp.put_u8(self.secondary_control_sysid);
12780 __tmp.put_u8(self.secondary_control_compid);
12781 if matches!(version, MavlinkVersion::V2) {
12782 let len = __tmp.len();
12783 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12784 } else {
12785 __tmp.len()
12786 }
12787 }
12788}
12789#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
12790#[doc = ""]
12791#[doc = "ID: 33"]
12792#[derive(Debug, Clone, PartialEq)]
12793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12795pub struct GLOBAL_POSITION_INT_DATA {
12796 #[doc = "Timestamp (time since system boot)."]
12797 pub time_boot_ms: u32,
12798 #[doc = "Latitude, expressed"]
12799 pub lat: i32,
12800 #[doc = "Longitude, expressed"]
12801 pub lon: i32,
12802 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
12803 pub alt: i32,
12804 #[doc = "Altitude above home"]
12805 pub relative_alt: i32,
12806 #[doc = "Ground X Speed (Latitude, positive north)"]
12807 pub vx: i16,
12808 #[doc = "Ground Y Speed (Longitude, positive east)"]
12809 pub vy: i16,
12810 #[doc = "Ground Z Speed (Altitude, positive down)"]
12811 pub vz: i16,
12812 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
12813 pub hdg: u16,
12814}
12815impl GLOBAL_POSITION_INT_DATA {
12816 pub const ENCODED_LEN: usize = 28usize;
12817 pub const DEFAULT: Self = Self {
12818 time_boot_ms: 0_u32,
12819 lat: 0_i32,
12820 lon: 0_i32,
12821 alt: 0_i32,
12822 relative_alt: 0_i32,
12823 vx: 0_i16,
12824 vy: 0_i16,
12825 vz: 0_i16,
12826 hdg: 0_u16,
12827 };
12828 #[cfg(feature = "arbitrary")]
12829 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12830 use arbitrary::{Arbitrary, Unstructured};
12831 let mut buf = [0u8; 1024];
12832 rng.fill_bytes(&mut buf);
12833 let mut unstructured = Unstructured::new(&buf);
12834 Self::arbitrary(&mut unstructured).unwrap_or_default()
12835 }
12836}
12837impl Default for GLOBAL_POSITION_INT_DATA {
12838 fn default() -> Self {
12839 Self::DEFAULT.clone()
12840 }
12841}
12842impl MessageData for GLOBAL_POSITION_INT_DATA {
12843 type Message = MavMessage;
12844 const ID: u32 = 33u32;
12845 const NAME: &'static str = "GLOBAL_POSITION_INT";
12846 const EXTRA_CRC: u8 = 104u8;
12847 const ENCODED_LEN: usize = 28usize;
12848 fn deser(
12849 _version: MavlinkVersion,
12850 __input: &[u8],
12851 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12852 let avail_len = __input.len();
12853 let mut payload_buf = [0; Self::ENCODED_LEN];
12854 let mut buf = if avail_len < Self::ENCODED_LEN {
12855 payload_buf[0..avail_len].copy_from_slice(__input);
12856 Bytes::new(&payload_buf)
12857 } else {
12858 Bytes::new(__input)
12859 };
12860 let mut __struct = Self::default();
12861 __struct.time_boot_ms = buf.get_u32_le();
12862 __struct.lat = buf.get_i32_le();
12863 __struct.lon = buf.get_i32_le();
12864 __struct.alt = buf.get_i32_le();
12865 __struct.relative_alt = buf.get_i32_le();
12866 __struct.vx = buf.get_i16_le();
12867 __struct.vy = buf.get_i16_le();
12868 __struct.vz = buf.get_i16_le();
12869 __struct.hdg = buf.get_u16_le();
12870 Ok(__struct)
12871 }
12872 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12873 let mut __tmp = BytesMut::new(bytes);
12874 #[allow(clippy::absurd_extreme_comparisons)]
12875 #[allow(unused_comparisons)]
12876 if __tmp.remaining() < Self::ENCODED_LEN {
12877 panic!(
12878 "buffer is too small (need {} bytes, but got {})",
12879 Self::ENCODED_LEN,
12880 __tmp.remaining(),
12881 )
12882 }
12883 __tmp.put_u32_le(self.time_boot_ms);
12884 __tmp.put_i32_le(self.lat);
12885 __tmp.put_i32_le(self.lon);
12886 __tmp.put_i32_le(self.alt);
12887 __tmp.put_i32_le(self.relative_alt);
12888 __tmp.put_i16_le(self.vx);
12889 __tmp.put_i16_le(self.vy);
12890 __tmp.put_i16_le(self.vz);
12891 __tmp.put_u16_le(self.hdg);
12892 if matches!(version, MavlinkVersion::V2) {
12893 let len = __tmp.len();
12894 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12895 } else {
12896 __tmp.len()
12897 }
12898 }
12899}
12900#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
12901#[doc = ""]
12902#[doc = "ID: 63"]
12903#[derive(Debug, Clone, PartialEq)]
12904#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12905#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12906pub struct GLOBAL_POSITION_INT_COV_DATA {
12907 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
12908 pub time_usec: u64,
12909 #[doc = "Latitude"]
12910 pub lat: i32,
12911 #[doc = "Longitude"]
12912 pub lon: i32,
12913 #[doc = "Altitude in meters above MSL"]
12914 pub alt: i32,
12915 #[doc = "Altitude above ground"]
12916 pub relative_alt: i32,
12917 #[doc = "Ground X Speed (Latitude)"]
12918 pub vx: f32,
12919 #[doc = "Ground Y Speed (Longitude)"]
12920 pub vy: f32,
12921 #[doc = "Ground Z Speed (Altitude)"]
12922 pub vz: f32,
12923 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
12924 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12925 pub covariance: [f32; 36],
12926 #[doc = "Class id of the estimator this estimate originated from."]
12927 pub estimator_type: MavEstimatorType,
12928}
12929impl GLOBAL_POSITION_INT_COV_DATA {
12930 pub const ENCODED_LEN: usize = 181usize;
12931 pub const DEFAULT: Self = Self {
12932 time_usec: 0_u64,
12933 lat: 0_i32,
12934 lon: 0_i32,
12935 alt: 0_i32,
12936 relative_alt: 0_i32,
12937 vx: 0.0_f32,
12938 vy: 0.0_f32,
12939 vz: 0.0_f32,
12940 covariance: [0.0_f32; 36usize],
12941 estimator_type: MavEstimatorType::DEFAULT,
12942 };
12943 #[cfg(feature = "arbitrary")]
12944 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12945 use arbitrary::{Arbitrary, Unstructured};
12946 let mut buf = [0u8; 1024];
12947 rng.fill_bytes(&mut buf);
12948 let mut unstructured = Unstructured::new(&buf);
12949 Self::arbitrary(&mut unstructured).unwrap_or_default()
12950 }
12951}
12952impl Default for GLOBAL_POSITION_INT_COV_DATA {
12953 fn default() -> Self {
12954 Self::DEFAULT.clone()
12955 }
12956}
12957impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
12958 type Message = MavMessage;
12959 const ID: u32 = 63u32;
12960 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
12961 const EXTRA_CRC: u8 = 119u8;
12962 const ENCODED_LEN: usize = 181usize;
12963 fn deser(
12964 _version: MavlinkVersion,
12965 __input: &[u8],
12966 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12967 let avail_len = __input.len();
12968 let mut payload_buf = [0; Self::ENCODED_LEN];
12969 let mut buf = if avail_len < Self::ENCODED_LEN {
12970 payload_buf[0..avail_len].copy_from_slice(__input);
12971 Bytes::new(&payload_buf)
12972 } else {
12973 Bytes::new(__input)
12974 };
12975 let mut __struct = Self::default();
12976 __struct.time_usec = buf.get_u64_le();
12977 __struct.lat = buf.get_i32_le();
12978 __struct.lon = buf.get_i32_le();
12979 __struct.alt = buf.get_i32_le();
12980 __struct.relative_alt = buf.get_i32_le();
12981 __struct.vx = buf.get_f32_le();
12982 __struct.vy = buf.get_f32_le();
12983 __struct.vz = buf.get_f32_le();
12984 for v in &mut __struct.covariance {
12985 let val = buf.get_f32_le();
12986 *v = val;
12987 }
12988 let tmp = buf.get_u8();
12989 __struct.estimator_type =
12990 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12991 enum_type: "MavEstimatorType",
12992 value: tmp as u32,
12993 })?;
12994 Ok(__struct)
12995 }
12996 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12997 let mut __tmp = BytesMut::new(bytes);
12998 #[allow(clippy::absurd_extreme_comparisons)]
12999 #[allow(unused_comparisons)]
13000 if __tmp.remaining() < Self::ENCODED_LEN {
13001 panic!(
13002 "buffer is too small (need {} bytes, but got {})",
13003 Self::ENCODED_LEN,
13004 __tmp.remaining(),
13005 )
13006 }
13007 __tmp.put_u64_le(self.time_usec);
13008 __tmp.put_i32_le(self.lat);
13009 __tmp.put_i32_le(self.lon);
13010 __tmp.put_i32_le(self.alt);
13011 __tmp.put_i32_le(self.relative_alt);
13012 __tmp.put_f32_le(self.vx);
13013 __tmp.put_f32_le(self.vy);
13014 __tmp.put_f32_le(self.vz);
13015 for val in &self.covariance {
13016 __tmp.put_f32_le(*val);
13017 }
13018 __tmp.put_u8(self.estimator_type as u8);
13019 if matches!(version, MavlinkVersion::V2) {
13020 let len = __tmp.len();
13021 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13022 } else {
13023 __tmp.len()
13024 }
13025 }
13026}
13027#[doc = "Global position/attitude estimate from a vision source."]
13028#[doc = ""]
13029#[doc = "ID: 101"]
13030#[derive(Debug, Clone, PartialEq)]
13031#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13032#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13033pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13034 #[doc = "Timestamp (UNIX time or since system boot)"]
13035 pub usec: u64,
13036 #[doc = "Global X position"]
13037 pub x: f32,
13038 #[doc = "Global Y position"]
13039 pub y: f32,
13040 #[doc = "Global Z position"]
13041 pub z: f32,
13042 #[doc = "Roll angle"]
13043 pub roll: f32,
13044 #[doc = "Pitch angle"]
13045 pub pitch: f32,
13046 #[doc = "Yaw angle"]
13047 pub yaw: f32,
13048 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13049 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13050 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13051 pub covariance: [f32; 21],
13052 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13053 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13054 pub reset_counter: u8,
13055}
13056impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13057 pub const ENCODED_LEN: usize = 117usize;
13058 pub const DEFAULT: Self = Self {
13059 usec: 0_u64,
13060 x: 0.0_f32,
13061 y: 0.0_f32,
13062 z: 0.0_f32,
13063 roll: 0.0_f32,
13064 pitch: 0.0_f32,
13065 yaw: 0.0_f32,
13066 covariance: [0.0_f32; 21usize],
13067 reset_counter: 0_u8,
13068 };
13069 #[cfg(feature = "arbitrary")]
13070 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13071 use arbitrary::{Arbitrary, Unstructured};
13072 let mut buf = [0u8; 1024];
13073 rng.fill_bytes(&mut buf);
13074 let mut unstructured = Unstructured::new(&buf);
13075 Self::arbitrary(&mut unstructured).unwrap_or_default()
13076 }
13077}
13078impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13079 fn default() -> Self {
13080 Self::DEFAULT.clone()
13081 }
13082}
13083impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13084 type Message = MavMessage;
13085 const ID: u32 = 101u32;
13086 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13087 const EXTRA_CRC: u8 = 102u8;
13088 const ENCODED_LEN: usize = 117usize;
13089 fn deser(
13090 _version: MavlinkVersion,
13091 __input: &[u8],
13092 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13093 let avail_len = __input.len();
13094 let mut payload_buf = [0; Self::ENCODED_LEN];
13095 let mut buf = if avail_len < Self::ENCODED_LEN {
13096 payload_buf[0..avail_len].copy_from_slice(__input);
13097 Bytes::new(&payload_buf)
13098 } else {
13099 Bytes::new(__input)
13100 };
13101 let mut __struct = Self::default();
13102 __struct.usec = buf.get_u64_le();
13103 __struct.x = buf.get_f32_le();
13104 __struct.y = buf.get_f32_le();
13105 __struct.z = buf.get_f32_le();
13106 __struct.roll = buf.get_f32_le();
13107 __struct.pitch = buf.get_f32_le();
13108 __struct.yaw = buf.get_f32_le();
13109 for v in &mut __struct.covariance {
13110 let val = buf.get_f32_le();
13111 *v = val;
13112 }
13113 __struct.reset_counter = buf.get_u8();
13114 Ok(__struct)
13115 }
13116 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13117 let mut __tmp = BytesMut::new(bytes);
13118 #[allow(clippy::absurd_extreme_comparisons)]
13119 #[allow(unused_comparisons)]
13120 if __tmp.remaining() < Self::ENCODED_LEN {
13121 panic!(
13122 "buffer is too small (need {} bytes, but got {})",
13123 Self::ENCODED_LEN,
13124 __tmp.remaining(),
13125 )
13126 }
13127 __tmp.put_u64_le(self.usec);
13128 __tmp.put_f32_le(self.x);
13129 __tmp.put_f32_le(self.y);
13130 __tmp.put_f32_le(self.z);
13131 __tmp.put_f32_le(self.roll);
13132 __tmp.put_f32_le(self.pitch);
13133 __tmp.put_f32_le(self.yaw);
13134 if matches!(version, MavlinkVersion::V2) {
13135 for val in &self.covariance {
13136 __tmp.put_f32_le(*val);
13137 }
13138 __tmp.put_u8(self.reset_counter);
13139 let len = __tmp.len();
13140 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13141 } else {
13142 __tmp.len()
13143 }
13144 }
13145}
13146#[doc = "Second GPS data."]
13147#[doc = ""]
13148#[doc = "ID: 124"]
13149#[derive(Debug, Clone, PartialEq)]
13150#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13151#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13152pub struct GPS2_RAW_DATA {
13153 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13154 pub time_usec: u64,
13155 #[doc = "Latitude (WGS84)"]
13156 pub lat: i32,
13157 #[doc = "Longitude (WGS84)"]
13158 pub lon: i32,
13159 #[doc = "Altitude (MSL). Positive for up."]
13160 pub alt: i32,
13161 #[doc = "Age of DGPS info"]
13162 pub dgps_age: u32,
13163 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13164 pub eph: u16,
13165 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13166 pub epv: u16,
13167 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13168 pub vel: u16,
13169 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13170 pub cog: u16,
13171 #[doc = "GPS fix type."]
13172 pub fix_type: GpsFixType,
13173 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13174 pub satellites_visible: u8,
13175 #[doc = "Number of DGPS satellites"]
13176 pub dgps_numch: u8,
13177 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13178 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13179 pub yaw: u16,
13180 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13181 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13182 pub alt_ellipsoid: i32,
13183 #[doc = "Position uncertainty."]
13184 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13185 pub h_acc: u32,
13186 #[doc = "Altitude uncertainty."]
13187 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13188 pub v_acc: u32,
13189 #[doc = "Speed uncertainty."]
13190 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13191 pub vel_acc: u32,
13192 #[doc = "Heading / track uncertainty"]
13193 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13194 pub hdg_acc: u32,
13195}
13196impl GPS2_RAW_DATA {
13197 pub const ENCODED_LEN: usize = 57usize;
13198 pub const DEFAULT: Self = Self {
13199 time_usec: 0_u64,
13200 lat: 0_i32,
13201 lon: 0_i32,
13202 alt: 0_i32,
13203 dgps_age: 0_u32,
13204 eph: 0_u16,
13205 epv: 0_u16,
13206 vel: 0_u16,
13207 cog: 0_u16,
13208 fix_type: GpsFixType::DEFAULT,
13209 satellites_visible: 0_u8,
13210 dgps_numch: 0_u8,
13211 yaw: 0_u16,
13212 alt_ellipsoid: 0_i32,
13213 h_acc: 0_u32,
13214 v_acc: 0_u32,
13215 vel_acc: 0_u32,
13216 hdg_acc: 0_u32,
13217 };
13218 #[cfg(feature = "arbitrary")]
13219 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13220 use arbitrary::{Arbitrary, Unstructured};
13221 let mut buf = [0u8; 1024];
13222 rng.fill_bytes(&mut buf);
13223 let mut unstructured = Unstructured::new(&buf);
13224 Self::arbitrary(&mut unstructured).unwrap_or_default()
13225 }
13226}
13227impl Default for GPS2_RAW_DATA {
13228 fn default() -> Self {
13229 Self::DEFAULT.clone()
13230 }
13231}
13232impl MessageData for GPS2_RAW_DATA {
13233 type Message = MavMessage;
13234 const ID: u32 = 124u32;
13235 const NAME: &'static str = "GPS2_RAW";
13236 const EXTRA_CRC: u8 = 87u8;
13237 const ENCODED_LEN: usize = 57usize;
13238 fn deser(
13239 _version: MavlinkVersion,
13240 __input: &[u8],
13241 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13242 let avail_len = __input.len();
13243 let mut payload_buf = [0; Self::ENCODED_LEN];
13244 let mut buf = if avail_len < Self::ENCODED_LEN {
13245 payload_buf[0..avail_len].copy_from_slice(__input);
13246 Bytes::new(&payload_buf)
13247 } else {
13248 Bytes::new(__input)
13249 };
13250 let mut __struct = Self::default();
13251 __struct.time_usec = buf.get_u64_le();
13252 __struct.lat = buf.get_i32_le();
13253 __struct.lon = buf.get_i32_le();
13254 __struct.alt = buf.get_i32_le();
13255 __struct.dgps_age = buf.get_u32_le();
13256 __struct.eph = buf.get_u16_le();
13257 __struct.epv = buf.get_u16_le();
13258 __struct.vel = buf.get_u16_le();
13259 __struct.cog = buf.get_u16_le();
13260 let tmp = buf.get_u8();
13261 __struct.fix_type =
13262 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13263 enum_type: "GpsFixType",
13264 value: tmp as u32,
13265 })?;
13266 __struct.satellites_visible = buf.get_u8();
13267 __struct.dgps_numch = buf.get_u8();
13268 __struct.yaw = buf.get_u16_le();
13269 __struct.alt_ellipsoid = buf.get_i32_le();
13270 __struct.h_acc = buf.get_u32_le();
13271 __struct.v_acc = buf.get_u32_le();
13272 __struct.vel_acc = buf.get_u32_le();
13273 __struct.hdg_acc = buf.get_u32_le();
13274 Ok(__struct)
13275 }
13276 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13277 let mut __tmp = BytesMut::new(bytes);
13278 #[allow(clippy::absurd_extreme_comparisons)]
13279 #[allow(unused_comparisons)]
13280 if __tmp.remaining() < Self::ENCODED_LEN {
13281 panic!(
13282 "buffer is too small (need {} bytes, but got {})",
13283 Self::ENCODED_LEN,
13284 __tmp.remaining(),
13285 )
13286 }
13287 __tmp.put_u64_le(self.time_usec);
13288 __tmp.put_i32_le(self.lat);
13289 __tmp.put_i32_le(self.lon);
13290 __tmp.put_i32_le(self.alt);
13291 __tmp.put_u32_le(self.dgps_age);
13292 __tmp.put_u16_le(self.eph);
13293 __tmp.put_u16_le(self.epv);
13294 __tmp.put_u16_le(self.vel);
13295 __tmp.put_u16_le(self.cog);
13296 __tmp.put_u8(self.fix_type as u8);
13297 __tmp.put_u8(self.satellites_visible);
13298 __tmp.put_u8(self.dgps_numch);
13299 if matches!(version, MavlinkVersion::V2) {
13300 __tmp.put_u16_le(self.yaw);
13301 __tmp.put_i32_le(self.alt_ellipsoid);
13302 __tmp.put_u32_le(self.h_acc);
13303 __tmp.put_u32_le(self.v_acc);
13304 __tmp.put_u32_le(self.vel_acc);
13305 __tmp.put_u32_le(self.hdg_acc);
13306 let len = __tmp.len();
13307 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13308 } else {
13309 __tmp.len()
13310 }
13311 }
13312}
13313#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
13314#[doc = ""]
13315#[doc = "ID: 128"]
13316#[derive(Debug, Clone, PartialEq)]
13317#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13319pub struct GPS2_RTK_DATA {
13320 #[doc = "Time since boot of last baseline message received."]
13321 pub time_last_baseline_ms: u32,
13322 #[doc = "GPS Time of Week of last baseline"]
13323 pub tow: u32,
13324 #[doc = "Current baseline in ECEF x or NED north component."]
13325 pub baseline_a_mm: i32,
13326 #[doc = "Current baseline in ECEF y or NED east component."]
13327 pub baseline_b_mm: i32,
13328 #[doc = "Current baseline in ECEF z or NED down component."]
13329 pub baseline_c_mm: i32,
13330 #[doc = "Current estimate of baseline accuracy."]
13331 pub accuracy: u32,
13332 #[doc = "Current number of integer ambiguity hypotheses."]
13333 pub iar_num_hypotheses: i32,
13334 #[doc = "GPS Week Number of last baseline"]
13335 pub wn: u16,
13336 #[doc = "Identification of connected RTK receiver."]
13337 pub rtk_receiver_id: u8,
13338 #[doc = "GPS-specific health report for RTK data."]
13339 pub rtk_health: u8,
13340 #[doc = "Rate of baseline messages being received by GPS"]
13341 pub rtk_rate: u8,
13342 #[doc = "Current number of sats used for RTK calculation."]
13343 pub nsats: u8,
13344 #[doc = "Coordinate system of baseline"]
13345 pub baseline_coords_type: RtkBaselineCoordinateSystem,
13346}
13347impl GPS2_RTK_DATA {
13348 pub const ENCODED_LEN: usize = 35usize;
13349 pub const DEFAULT: Self = Self {
13350 time_last_baseline_ms: 0_u32,
13351 tow: 0_u32,
13352 baseline_a_mm: 0_i32,
13353 baseline_b_mm: 0_i32,
13354 baseline_c_mm: 0_i32,
13355 accuracy: 0_u32,
13356 iar_num_hypotheses: 0_i32,
13357 wn: 0_u16,
13358 rtk_receiver_id: 0_u8,
13359 rtk_health: 0_u8,
13360 rtk_rate: 0_u8,
13361 nsats: 0_u8,
13362 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
13363 };
13364 #[cfg(feature = "arbitrary")]
13365 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13366 use arbitrary::{Arbitrary, Unstructured};
13367 let mut buf = [0u8; 1024];
13368 rng.fill_bytes(&mut buf);
13369 let mut unstructured = Unstructured::new(&buf);
13370 Self::arbitrary(&mut unstructured).unwrap_or_default()
13371 }
13372}
13373impl Default for GPS2_RTK_DATA {
13374 fn default() -> Self {
13375 Self::DEFAULT.clone()
13376 }
13377}
13378impl MessageData for GPS2_RTK_DATA {
13379 type Message = MavMessage;
13380 const ID: u32 = 128u32;
13381 const NAME: &'static str = "GPS2_RTK";
13382 const EXTRA_CRC: u8 = 226u8;
13383 const ENCODED_LEN: usize = 35usize;
13384 fn deser(
13385 _version: MavlinkVersion,
13386 __input: &[u8],
13387 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13388 let avail_len = __input.len();
13389 let mut payload_buf = [0; Self::ENCODED_LEN];
13390 let mut buf = if avail_len < Self::ENCODED_LEN {
13391 payload_buf[0..avail_len].copy_from_slice(__input);
13392 Bytes::new(&payload_buf)
13393 } else {
13394 Bytes::new(__input)
13395 };
13396 let mut __struct = Self::default();
13397 __struct.time_last_baseline_ms = buf.get_u32_le();
13398 __struct.tow = buf.get_u32_le();
13399 __struct.baseline_a_mm = buf.get_i32_le();
13400 __struct.baseline_b_mm = buf.get_i32_le();
13401 __struct.baseline_c_mm = buf.get_i32_le();
13402 __struct.accuracy = buf.get_u32_le();
13403 __struct.iar_num_hypotheses = buf.get_i32_le();
13404 __struct.wn = buf.get_u16_le();
13405 __struct.rtk_receiver_id = buf.get_u8();
13406 __struct.rtk_health = buf.get_u8();
13407 __struct.rtk_rate = buf.get_u8();
13408 __struct.nsats = buf.get_u8();
13409 let tmp = buf.get_u8();
13410 __struct.baseline_coords_type =
13411 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13412 enum_type: "RtkBaselineCoordinateSystem",
13413 value: tmp as u32,
13414 })?;
13415 Ok(__struct)
13416 }
13417 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13418 let mut __tmp = BytesMut::new(bytes);
13419 #[allow(clippy::absurd_extreme_comparisons)]
13420 #[allow(unused_comparisons)]
13421 if __tmp.remaining() < Self::ENCODED_LEN {
13422 panic!(
13423 "buffer is too small (need {} bytes, but got {})",
13424 Self::ENCODED_LEN,
13425 __tmp.remaining(),
13426 )
13427 }
13428 __tmp.put_u32_le(self.time_last_baseline_ms);
13429 __tmp.put_u32_le(self.tow);
13430 __tmp.put_i32_le(self.baseline_a_mm);
13431 __tmp.put_i32_le(self.baseline_b_mm);
13432 __tmp.put_i32_le(self.baseline_c_mm);
13433 __tmp.put_u32_le(self.accuracy);
13434 __tmp.put_i32_le(self.iar_num_hypotheses);
13435 __tmp.put_u16_le(self.wn);
13436 __tmp.put_u8(self.rtk_receiver_id);
13437 __tmp.put_u8(self.rtk_health);
13438 __tmp.put_u8(self.rtk_rate);
13439 __tmp.put_u8(self.nsats);
13440 __tmp.put_u8(self.baseline_coords_type as u8);
13441 if matches!(version, MavlinkVersion::V2) {
13442 let len = __tmp.len();
13443 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13444 } else {
13445 __tmp.len()
13446 }
13447 }
13448}
13449#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
13450#[doc = ""]
13451#[doc = "ID: 49"]
13452#[derive(Debug, Clone, PartialEq)]
13453#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13454#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13455pub struct GPS_GLOBAL_ORIGIN_DATA {
13456 #[doc = "Latitude (WGS84)"]
13457 pub latitude: i32,
13458 #[doc = "Longitude (WGS84)"]
13459 pub longitude: i32,
13460 #[doc = "Altitude (MSL). Positive for up."]
13461 pub altitude: i32,
13462 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13463 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13464 pub time_usec: u64,
13465}
13466impl GPS_GLOBAL_ORIGIN_DATA {
13467 pub const ENCODED_LEN: usize = 20usize;
13468 pub const DEFAULT: Self = Self {
13469 latitude: 0_i32,
13470 longitude: 0_i32,
13471 altitude: 0_i32,
13472 time_usec: 0_u64,
13473 };
13474 #[cfg(feature = "arbitrary")]
13475 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13476 use arbitrary::{Arbitrary, Unstructured};
13477 let mut buf = [0u8; 1024];
13478 rng.fill_bytes(&mut buf);
13479 let mut unstructured = Unstructured::new(&buf);
13480 Self::arbitrary(&mut unstructured).unwrap_or_default()
13481 }
13482}
13483impl Default for GPS_GLOBAL_ORIGIN_DATA {
13484 fn default() -> Self {
13485 Self::DEFAULT.clone()
13486 }
13487}
13488impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
13489 type Message = MavMessage;
13490 const ID: u32 = 49u32;
13491 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
13492 const EXTRA_CRC: u8 = 39u8;
13493 const ENCODED_LEN: usize = 20usize;
13494 fn deser(
13495 _version: MavlinkVersion,
13496 __input: &[u8],
13497 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13498 let avail_len = __input.len();
13499 let mut payload_buf = [0; Self::ENCODED_LEN];
13500 let mut buf = if avail_len < Self::ENCODED_LEN {
13501 payload_buf[0..avail_len].copy_from_slice(__input);
13502 Bytes::new(&payload_buf)
13503 } else {
13504 Bytes::new(__input)
13505 };
13506 let mut __struct = Self::default();
13507 __struct.latitude = buf.get_i32_le();
13508 __struct.longitude = buf.get_i32_le();
13509 __struct.altitude = buf.get_i32_le();
13510 __struct.time_usec = buf.get_u64_le();
13511 Ok(__struct)
13512 }
13513 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13514 let mut __tmp = BytesMut::new(bytes);
13515 #[allow(clippy::absurd_extreme_comparisons)]
13516 #[allow(unused_comparisons)]
13517 if __tmp.remaining() < Self::ENCODED_LEN {
13518 panic!(
13519 "buffer is too small (need {} bytes, but got {})",
13520 Self::ENCODED_LEN,
13521 __tmp.remaining(),
13522 )
13523 }
13524 __tmp.put_i32_le(self.latitude);
13525 __tmp.put_i32_le(self.longitude);
13526 __tmp.put_i32_le(self.altitude);
13527 if matches!(version, MavlinkVersion::V2) {
13528 __tmp.put_u64_le(self.time_usec);
13529 let len = __tmp.len();
13530 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13531 } else {
13532 __tmp.len()
13533 }
13534 }
13535}
13536#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
13537#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
13538#[doc = ""]
13539#[doc = "ID: 123"]
13540#[derive(Debug, Clone, PartialEq)]
13541#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13542#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13543pub struct GPS_INJECT_DATA_DATA {
13544 #[doc = "System ID"]
13545 pub target_system: u8,
13546 #[doc = "Component ID"]
13547 pub target_component: u8,
13548 #[doc = "Data length"]
13549 pub len: u8,
13550 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
13551 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13552 pub data: [u8; 110],
13553}
13554impl GPS_INJECT_DATA_DATA {
13555 pub const ENCODED_LEN: usize = 113usize;
13556 pub const DEFAULT: Self = Self {
13557 target_system: 0_u8,
13558 target_component: 0_u8,
13559 len: 0_u8,
13560 data: [0_u8; 110usize],
13561 };
13562 #[cfg(feature = "arbitrary")]
13563 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13564 use arbitrary::{Arbitrary, Unstructured};
13565 let mut buf = [0u8; 1024];
13566 rng.fill_bytes(&mut buf);
13567 let mut unstructured = Unstructured::new(&buf);
13568 Self::arbitrary(&mut unstructured).unwrap_or_default()
13569 }
13570}
13571impl Default for GPS_INJECT_DATA_DATA {
13572 fn default() -> Self {
13573 Self::DEFAULT.clone()
13574 }
13575}
13576impl MessageData for GPS_INJECT_DATA_DATA {
13577 type Message = MavMessage;
13578 const ID: u32 = 123u32;
13579 const NAME: &'static str = "GPS_INJECT_DATA";
13580 const EXTRA_CRC: u8 = 250u8;
13581 const ENCODED_LEN: usize = 113usize;
13582 fn deser(
13583 _version: MavlinkVersion,
13584 __input: &[u8],
13585 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13586 let avail_len = __input.len();
13587 let mut payload_buf = [0; Self::ENCODED_LEN];
13588 let mut buf = if avail_len < Self::ENCODED_LEN {
13589 payload_buf[0..avail_len].copy_from_slice(__input);
13590 Bytes::new(&payload_buf)
13591 } else {
13592 Bytes::new(__input)
13593 };
13594 let mut __struct = Self::default();
13595 __struct.target_system = buf.get_u8();
13596 __struct.target_component = buf.get_u8();
13597 __struct.len = buf.get_u8();
13598 for v in &mut __struct.data {
13599 let val = buf.get_u8();
13600 *v = val;
13601 }
13602 Ok(__struct)
13603 }
13604 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13605 let mut __tmp = BytesMut::new(bytes);
13606 #[allow(clippy::absurd_extreme_comparisons)]
13607 #[allow(unused_comparisons)]
13608 if __tmp.remaining() < Self::ENCODED_LEN {
13609 panic!(
13610 "buffer is too small (need {} bytes, but got {})",
13611 Self::ENCODED_LEN,
13612 __tmp.remaining(),
13613 )
13614 }
13615 __tmp.put_u8(self.target_system);
13616 __tmp.put_u8(self.target_component);
13617 __tmp.put_u8(self.len);
13618 for val in &self.data {
13619 __tmp.put_u8(*val);
13620 }
13621 if matches!(version, MavlinkVersion::V2) {
13622 let len = __tmp.len();
13623 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13624 } else {
13625 __tmp.len()
13626 }
13627 }
13628}
13629#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
13630#[doc = ""]
13631#[doc = "ID: 232"]
13632#[derive(Debug, Clone, PartialEq)]
13633#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13634#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13635pub struct GPS_INPUT_DATA {
13636 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13637 pub time_usec: u64,
13638 #[doc = "GPS time (from start of GPS week)"]
13639 pub time_week_ms: u32,
13640 #[doc = "Latitude (WGS84)"]
13641 pub lat: i32,
13642 #[doc = "Longitude (WGS84)"]
13643 pub lon: i32,
13644 #[doc = "Altitude (MSL). Positive for up."]
13645 pub alt: f32,
13646 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
13647 pub hdop: f32,
13648 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
13649 pub vdop: f32,
13650 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
13651 pub vn: f32,
13652 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
13653 pub ve: f32,
13654 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
13655 pub vd: f32,
13656 #[doc = "GPS speed accuracy"]
13657 pub speed_accuracy: f32,
13658 #[doc = "GPS horizontal accuracy"]
13659 pub horiz_accuracy: f32,
13660 #[doc = "GPS vertical accuracy"]
13661 pub vert_accuracy: f32,
13662 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
13663 pub ignore_flags: GpsInputIgnoreFlags,
13664 #[doc = "GPS week number"]
13665 pub time_week: u16,
13666 #[doc = "ID of the GPS for multiple GPS inputs"]
13667 pub gps_id: u8,
13668 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
13669 pub fix_type: u8,
13670 #[doc = "Number of satellites visible."]
13671 pub satellites_visible: u8,
13672 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
13673 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13674 pub yaw: u16,
13675}
13676impl GPS_INPUT_DATA {
13677 pub const ENCODED_LEN: usize = 65usize;
13678 pub const DEFAULT: Self = Self {
13679 time_usec: 0_u64,
13680 time_week_ms: 0_u32,
13681 lat: 0_i32,
13682 lon: 0_i32,
13683 alt: 0.0_f32,
13684 hdop: 0.0_f32,
13685 vdop: 0.0_f32,
13686 vn: 0.0_f32,
13687 ve: 0.0_f32,
13688 vd: 0.0_f32,
13689 speed_accuracy: 0.0_f32,
13690 horiz_accuracy: 0.0_f32,
13691 vert_accuracy: 0.0_f32,
13692 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
13693 time_week: 0_u16,
13694 gps_id: 0_u8,
13695 fix_type: 0_u8,
13696 satellites_visible: 0_u8,
13697 yaw: 0_u16,
13698 };
13699 #[cfg(feature = "arbitrary")]
13700 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13701 use arbitrary::{Arbitrary, Unstructured};
13702 let mut buf = [0u8; 1024];
13703 rng.fill_bytes(&mut buf);
13704 let mut unstructured = Unstructured::new(&buf);
13705 Self::arbitrary(&mut unstructured).unwrap_or_default()
13706 }
13707}
13708impl Default for GPS_INPUT_DATA {
13709 fn default() -> Self {
13710 Self::DEFAULT.clone()
13711 }
13712}
13713impl MessageData for GPS_INPUT_DATA {
13714 type Message = MavMessage;
13715 const ID: u32 = 232u32;
13716 const NAME: &'static str = "GPS_INPUT";
13717 const EXTRA_CRC: u8 = 151u8;
13718 const ENCODED_LEN: usize = 65usize;
13719 fn deser(
13720 _version: MavlinkVersion,
13721 __input: &[u8],
13722 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13723 let avail_len = __input.len();
13724 let mut payload_buf = [0; Self::ENCODED_LEN];
13725 let mut buf = if avail_len < Self::ENCODED_LEN {
13726 payload_buf[0..avail_len].copy_from_slice(__input);
13727 Bytes::new(&payload_buf)
13728 } else {
13729 Bytes::new(__input)
13730 };
13731 let mut __struct = Self::default();
13732 __struct.time_usec = buf.get_u64_le();
13733 __struct.time_week_ms = buf.get_u32_le();
13734 __struct.lat = buf.get_i32_le();
13735 __struct.lon = buf.get_i32_le();
13736 __struct.alt = buf.get_f32_le();
13737 __struct.hdop = buf.get_f32_le();
13738 __struct.vdop = buf.get_f32_le();
13739 __struct.vn = buf.get_f32_le();
13740 __struct.ve = buf.get_f32_le();
13741 __struct.vd = buf.get_f32_le();
13742 __struct.speed_accuracy = buf.get_f32_le();
13743 __struct.horiz_accuracy = buf.get_f32_le();
13744 __struct.vert_accuracy = buf.get_f32_le();
13745 let tmp = buf.get_u16_le();
13746 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
13747 tmp & GpsInputIgnoreFlags::all().bits(),
13748 )
13749 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13750 flag_type: "GpsInputIgnoreFlags",
13751 value: tmp as u32,
13752 })?;
13753 __struct.time_week = buf.get_u16_le();
13754 __struct.gps_id = buf.get_u8();
13755 __struct.fix_type = buf.get_u8();
13756 __struct.satellites_visible = buf.get_u8();
13757 __struct.yaw = buf.get_u16_le();
13758 Ok(__struct)
13759 }
13760 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13761 let mut __tmp = BytesMut::new(bytes);
13762 #[allow(clippy::absurd_extreme_comparisons)]
13763 #[allow(unused_comparisons)]
13764 if __tmp.remaining() < Self::ENCODED_LEN {
13765 panic!(
13766 "buffer is too small (need {} bytes, but got {})",
13767 Self::ENCODED_LEN,
13768 __tmp.remaining(),
13769 )
13770 }
13771 __tmp.put_u64_le(self.time_usec);
13772 __tmp.put_u32_le(self.time_week_ms);
13773 __tmp.put_i32_le(self.lat);
13774 __tmp.put_i32_le(self.lon);
13775 __tmp.put_f32_le(self.alt);
13776 __tmp.put_f32_le(self.hdop);
13777 __tmp.put_f32_le(self.vdop);
13778 __tmp.put_f32_le(self.vn);
13779 __tmp.put_f32_le(self.ve);
13780 __tmp.put_f32_le(self.vd);
13781 __tmp.put_f32_le(self.speed_accuracy);
13782 __tmp.put_f32_le(self.horiz_accuracy);
13783 __tmp.put_f32_le(self.vert_accuracy);
13784 __tmp.put_u16_le(self.ignore_flags.bits());
13785 __tmp.put_u16_le(self.time_week);
13786 __tmp.put_u8(self.gps_id);
13787 __tmp.put_u8(self.fix_type);
13788 __tmp.put_u8(self.satellites_visible);
13789 if matches!(version, MavlinkVersion::V2) {
13790 __tmp.put_u16_le(self.yaw);
13791 let len = __tmp.len();
13792 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13793 } else {
13794 __tmp.len()
13795 }
13796 }
13797}
13798#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
13799#[doc = ""]
13800#[doc = "ID: 24"]
13801#[derive(Debug, Clone, PartialEq)]
13802#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13803#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13804pub struct GPS_RAW_INT_DATA {
13805 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13806 pub time_usec: u64,
13807 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
13808 pub lat: i32,
13809 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
13810 pub lon: i32,
13811 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
13812 pub alt: i32,
13813 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13814 pub eph: u16,
13815 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13816 pub epv: u16,
13817 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13818 pub vel: u16,
13819 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13820 pub cog: u16,
13821 #[doc = "GPS fix type."]
13822 pub fix_type: GpsFixType,
13823 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13824 pub satellites_visible: u8,
13825 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13826 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13827 pub alt_ellipsoid: i32,
13828 #[doc = "Position uncertainty."]
13829 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13830 pub h_acc: u32,
13831 #[doc = "Altitude uncertainty."]
13832 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13833 pub v_acc: u32,
13834 #[doc = "Speed uncertainty."]
13835 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13836 pub vel_acc: u32,
13837 #[doc = "Heading / track uncertainty"]
13838 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13839 pub hdg_acc: u32,
13840 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13841 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13842 pub yaw: u16,
13843}
13844impl GPS_RAW_INT_DATA {
13845 pub const ENCODED_LEN: usize = 52usize;
13846 pub const DEFAULT: Self = Self {
13847 time_usec: 0_u64,
13848 lat: 0_i32,
13849 lon: 0_i32,
13850 alt: 0_i32,
13851 eph: 0_u16,
13852 epv: 0_u16,
13853 vel: 0_u16,
13854 cog: 0_u16,
13855 fix_type: GpsFixType::DEFAULT,
13856 satellites_visible: 0_u8,
13857 alt_ellipsoid: 0_i32,
13858 h_acc: 0_u32,
13859 v_acc: 0_u32,
13860 vel_acc: 0_u32,
13861 hdg_acc: 0_u32,
13862 yaw: 0_u16,
13863 };
13864 #[cfg(feature = "arbitrary")]
13865 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13866 use arbitrary::{Arbitrary, Unstructured};
13867 let mut buf = [0u8; 1024];
13868 rng.fill_bytes(&mut buf);
13869 let mut unstructured = Unstructured::new(&buf);
13870 Self::arbitrary(&mut unstructured).unwrap_or_default()
13871 }
13872}
13873impl Default for GPS_RAW_INT_DATA {
13874 fn default() -> Self {
13875 Self::DEFAULT.clone()
13876 }
13877}
13878impl MessageData for GPS_RAW_INT_DATA {
13879 type Message = MavMessage;
13880 const ID: u32 = 24u32;
13881 const NAME: &'static str = "GPS_RAW_INT";
13882 const EXTRA_CRC: u8 = 24u8;
13883 const ENCODED_LEN: usize = 52usize;
13884 fn deser(
13885 _version: MavlinkVersion,
13886 __input: &[u8],
13887 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13888 let avail_len = __input.len();
13889 let mut payload_buf = [0; Self::ENCODED_LEN];
13890 let mut buf = if avail_len < Self::ENCODED_LEN {
13891 payload_buf[0..avail_len].copy_from_slice(__input);
13892 Bytes::new(&payload_buf)
13893 } else {
13894 Bytes::new(__input)
13895 };
13896 let mut __struct = Self::default();
13897 __struct.time_usec = buf.get_u64_le();
13898 __struct.lat = buf.get_i32_le();
13899 __struct.lon = buf.get_i32_le();
13900 __struct.alt = buf.get_i32_le();
13901 __struct.eph = buf.get_u16_le();
13902 __struct.epv = buf.get_u16_le();
13903 __struct.vel = buf.get_u16_le();
13904 __struct.cog = buf.get_u16_le();
13905 let tmp = buf.get_u8();
13906 __struct.fix_type =
13907 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13908 enum_type: "GpsFixType",
13909 value: tmp as u32,
13910 })?;
13911 __struct.satellites_visible = buf.get_u8();
13912 __struct.alt_ellipsoid = buf.get_i32_le();
13913 __struct.h_acc = buf.get_u32_le();
13914 __struct.v_acc = buf.get_u32_le();
13915 __struct.vel_acc = buf.get_u32_le();
13916 __struct.hdg_acc = buf.get_u32_le();
13917 __struct.yaw = buf.get_u16_le();
13918 Ok(__struct)
13919 }
13920 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13921 let mut __tmp = BytesMut::new(bytes);
13922 #[allow(clippy::absurd_extreme_comparisons)]
13923 #[allow(unused_comparisons)]
13924 if __tmp.remaining() < Self::ENCODED_LEN {
13925 panic!(
13926 "buffer is too small (need {} bytes, but got {})",
13927 Self::ENCODED_LEN,
13928 __tmp.remaining(),
13929 )
13930 }
13931 __tmp.put_u64_le(self.time_usec);
13932 __tmp.put_i32_le(self.lat);
13933 __tmp.put_i32_le(self.lon);
13934 __tmp.put_i32_le(self.alt);
13935 __tmp.put_u16_le(self.eph);
13936 __tmp.put_u16_le(self.epv);
13937 __tmp.put_u16_le(self.vel);
13938 __tmp.put_u16_le(self.cog);
13939 __tmp.put_u8(self.fix_type as u8);
13940 __tmp.put_u8(self.satellites_visible);
13941 if matches!(version, MavlinkVersion::V2) {
13942 __tmp.put_i32_le(self.alt_ellipsoid);
13943 __tmp.put_u32_le(self.h_acc);
13944 __tmp.put_u32_le(self.v_acc);
13945 __tmp.put_u32_le(self.vel_acc);
13946 __tmp.put_u32_le(self.hdg_acc);
13947 __tmp.put_u16_le(self.yaw);
13948 let len = __tmp.len();
13949 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13950 } else {
13951 __tmp.len()
13952 }
13953 }
13954}
13955#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
13956#[doc = ""]
13957#[doc = "ID: 233"]
13958#[derive(Debug, Clone, PartialEq)]
13959#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13960#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13961pub struct GPS_RTCM_DATA_DATA {
13962 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
13963 pub flags: u8,
13964 #[doc = "data length"]
13965 pub len: u8,
13966 #[doc = "RTCM message (may be fragmented)"]
13967 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13968 pub data: [u8; 180],
13969}
13970impl GPS_RTCM_DATA_DATA {
13971 pub const ENCODED_LEN: usize = 182usize;
13972 pub const DEFAULT: Self = Self {
13973 flags: 0_u8,
13974 len: 0_u8,
13975 data: [0_u8; 180usize],
13976 };
13977 #[cfg(feature = "arbitrary")]
13978 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13979 use arbitrary::{Arbitrary, Unstructured};
13980 let mut buf = [0u8; 1024];
13981 rng.fill_bytes(&mut buf);
13982 let mut unstructured = Unstructured::new(&buf);
13983 Self::arbitrary(&mut unstructured).unwrap_or_default()
13984 }
13985}
13986impl Default for GPS_RTCM_DATA_DATA {
13987 fn default() -> Self {
13988 Self::DEFAULT.clone()
13989 }
13990}
13991impl MessageData for GPS_RTCM_DATA_DATA {
13992 type Message = MavMessage;
13993 const ID: u32 = 233u32;
13994 const NAME: &'static str = "GPS_RTCM_DATA";
13995 const EXTRA_CRC: u8 = 35u8;
13996 const ENCODED_LEN: usize = 182usize;
13997 fn deser(
13998 _version: MavlinkVersion,
13999 __input: &[u8],
14000 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14001 let avail_len = __input.len();
14002 let mut payload_buf = [0; Self::ENCODED_LEN];
14003 let mut buf = if avail_len < Self::ENCODED_LEN {
14004 payload_buf[0..avail_len].copy_from_slice(__input);
14005 Bytes::new(&payload_buf)
14006 } else {
14007 Bytes::new(__input)
14008 };
14009 let mut __struct = Self::default();
14010 __struct.flags = buf.get_u8();
14011 __struct.len = buf.get_u8();
14012 for v in &mut __struct.data {
14013 let val = buf.get_u8();
14014 *v = val;
14015 }
14016 Ok(__struct)
14017 }
14018 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14019 let mut __tmp = BytesMut::new(bytes);
14020 #[allow(clippy::absurd_extreme_comparisons)]
14021 #[allow(unused_comparisons)]
14022 if __tmp.remaining() < Self::ENCODED_LEN {
14023 panic!(
14024 "buffer is too small (need {} bytes, but got {})",
14025 Self::ENCODED_LEN,
14026 __tmp.remaining(),
14027 )
14028 }
14029 __tmp.put_u8(self.flags);
14030 __tmp.put_u8(self.len);
14031 for val in &self.data {
14032 __tmp.put_u8(*val);
14033 }
14034 if matches!(version, MavlinkVersion::V2) {
14035 let len = __tmp.len();
14036 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14037 } else {
14038 __tmp.len()
14039 }
14040 }
14041}
14042#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14043#[doc = ""]
14044#[doc = "ID: 127"]
14045#[derive(Debug, Clone, PartialEq)]
14046#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14047#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14048pub struct GPS_RTK_DATA {
14049 #[doc = "Time since boot of last baseline message received."]
14050 pub time_last_baseline_ms: u32,
14051 #[doc = "GPS Time of Week of last baseline"]
14052 pub tow: u32,
14053 #[doc = "Current baseline in ECEF x or NED north component."]
14054 pub baseline_a_mm: i32,
14055 #[doc = "Current baseline in ECEF y or NED east component."]
14056 pub baseline_b_mm: i32,
14057 #[doc = "Current baseline in ECEF z or NED down component."]
14058 pub baseline_c_mm: i32,
14059 #[doc = "Current estimate of baseline accuracy."]
14060 pub accuracy: u32,
14061 #[doc = "Current number of integer ambiguity hypotheses."]
14062 pub iar_num_hypotheses: i32,
14063 #[doc = "GPS Week Number of last baseline"]
14064 pub wn: u16,
14065 #[doc = "Identification of connected RTK receiver."]
14066 pub rtk_receiver_id: u8,
14067 #[doc = "GPS-specific health report for RTK data."]
14068 pub rtk_health: u8,
14069 #[doc = "Rate of baseline messages being received by GPS"]
14070 pub rtk_rate: u8,
14071 #[doc = "Current number of sats used for RTK calculation."]
14072 pub nsats: u8,
14073 #[doc = "Coordinate system of baseline"]
14074 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14075}
14076impl GPS_RTK_DATA {
14077 pub const ENCODED_LEN: usize = 35usize;
14078 pub const DEFAULT: Self = Self {
14079 time_last_baseline_ms: 0_u32,
14080 tow: 0_u32,
14081 baseline_a_mm: 0_i32,
14082 baseline_b_mm: 0_i32,
14083 baseline_c_mm: 0_i32,
14084 accuracy: 0_u32,
14085 iar_num_hypotheses: 0_i32,
14086 wn: 0_u16,
14087 rtk_receiver_id: 0_u8,
14088 rtk_health: 0_u8,
14089 rtk_rate: 0_u8,
14090 nsats: 0_u8,
14091 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14092 };
14093 #[cfg(feature = "arbitrary")]
14094 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14095 use arbitrary::{Arbitrary, Unstructured};
14096 let mut buf = [0u8; 1024];
14097 rng.fill_bytes(&mut buf);
14098 let mut unstructured = Unstructured::new(&buf);
14099 Self::arbitrary(&mut unstructured).unwrap_or_default()
14100 }
14101}
14102impl Default for GPS_RTK_DATA {
14103 fn default() -> Self {
14104 Self::DEFAULT.clone()
14105 }
14106}
14107impl MessageData for GPS_RTK_DATA {
14108 type Message = MavMessage;
14109 const ID: u32 = 127u32;
14110 const NAME: &'static str = "GPS_RTK";
14111 const EXTRA_CRC: u8 = 25u8;
14112 const ENCODED_LEN: usize = 35usize;
14113 fn deser(
14114 _version: MavlinkVersion,
14115 __input: &[u8],
14116 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14117 let avail_len = __input.len();
14118 let mut payload_buf = [0; Self::ENCODED_LEN];
14119 let mut buf = if avail_len < Self::ENCODED_LEN {
14120 payload_buf[0..avail_len].copy_from_slice(__input);
14121 Bytes::new(&payload_buf)
14122 } else {
14123 Bytes::new(__input)
14124 };
14125 let mut __struct = Self::default();
14126 __struct.time_last_baseline_ms = buf.get_u32_le();
14127 __struct.tow = buf.get_u32_le();
14128 __struct.baseline_a_mm = buf.get_i32_le();
14129 __struct.baseline_b_mm = buf.get_i32_le();
14130 __struct.baseline_c_mm = buf.get_i32_le();
14131 __struct.accuracy = buf.get_u32_le();
14132 __struct.iar_num_hypotheses = buf.get_i32_le();
14133 __struct.wn = buf.get_u16_le();
14134 __struct.rtk_receiver_id = buf.get_u8();
14135 __struct.rtk_health = buf.get_u8();
14136 __struct.rtk_rate = buf.get_u8();
14137 __struct.nsats = buf.get_u8();
14138 let tmp = buf.get_u8();
14139 __struct.baseline_coords_type =
14140 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14141 enum_type: "RtkBaselineCoordinateSystem",
14142 value: tmp as u32,
14143 })?;
14144 Ok(__struct)
14145 }
14146 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14147 let mut __tmp = BytesMut::new(bytes);
14148 #[allow(clippy::absurd_extreme_comparisons)]
14149 #[allow(unused_comparisons)]
14150 if __tmp.remaining() < Self::ENCODED_LEN {
14151 panic!(
14152 "buffer is too small (need {} bytes, but got {})",
14153 Self::ENCODED_LEN,
14154 __tmp.remaining(),
14155 )
14156 }
14157 __tmp.put_u32_le(self.time_last_baseline_ms);
14158 __tmp.put_u32_le(self.tow);
14159 __tmp.put_i32_le(self.baseline_a_mm);
14160 __tmp.put_i32_le(self.baseline_b_mm);
14161 __tmp.put_i32_le(self.baseline_c_mm);
14162 __tmp.put_u32_le(self.accuracy);
14163 __tmp.put_i32_le(self.iar_num_hypotheses);
14164 __tmp.put_u16_le(self.wn);
14165 __tmp.put_u8(self.rtk_receiver_id);
14166 __tmp.put_u8(self.rtk_health);
14167 __tmp.put_u8(self.rtk_rate);
14168 __tmp.put_u8(self.nsats);
14169 __tmp.put_u8(self.baseline_coords_type as u8);
14170 if matches!(version, MavlinkVersion::V2) {
14171 let len = __tmp.len();
14172 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14173 } else {
14174 __tmp.len()
14175 }
14176 }
14177}
14178#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14179#[doc = ""]
14180#[doc = "ID: 25"]
14181#[derive(Debug, Clone, PartialEq)]
14182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14184pub struct GPS_STATUS_DATA {
14185 #[doc = "Number of satellites visible"]
14186 pub satellites_visible: u8,
14187 #[doc = "Global satellite ID"]
14188 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14189 pub satellite_prn: [u8; 20],
14190 #[doc = "0: Satellite not used, 1: used for localization"]
14191 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14192 pub satellite_used: [u8; 20],
14193 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14194 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14195 pub satellite_elevation: [u8; 20],
14196 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14197 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14198 pub satellite_azimuth: [u8; 20],
14199 #[doc = "Signal to noise ratio of satellite"]
14200 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14201 pub satellite_snr: [u8; 20],
14202}
14203impl GPS_STATUS_DATA {
14204 pub const ENCODED_LEN: usize = 101usize;
14205 pub const DEFAULT: Self = Self {
14206 satellites_visible: 0_u8,
14207 satellite_prn: [0_u8; 20usize],
14208 satellite_used: [0_u8; 20usize],
14209 satellite_elevation: [0_u8; 20usize],
14210 satellite_azimuth: [0_u8; 20usize],
14211 satellite_snr: [0_u8; 20usize],
14212 };
14213 #[cfg(feature = "arbitrary")]
14214 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14215 use arbitrary::{Arbitrary, Unstructured};
14216 let mut buf = [0u8; 1024];
14217 rng.fill_bytes(&mut buf);
14218 let mut unstructured = Unstructured::new(&buf);
14219 Self::arbitrary(&mut unstructured).unwrap_or_default()
14220 }
14221}
14222impl Default for GPS_STATUS_DATA {
14223 fn default() -> Self {
14224 Self::DEFAULT.clone()
14225 }
14226}
14227impl MessageData for GPS_STATUS_DATA {
14228 type Message = MavMessage;
14229 const ID: u32 = 25u32;
14230 const NAME: &'static str = "GPS_STATUS";
14231 const EXTRA_CRC: u8 = 23u8;
14232 const ENCODED_LEN: usize = 101usize;
14233 fn deser(
14234 _version: MavlinkVersion,
14235 __input: &[u8],
14236 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14237 let avail_len = __input.len();
14238 let mut payload_buf = [0; Self::ENCODED_LEN];
14239 let mut buf = if avail_len < Self::ENCODED_LEN {
14240 payload_buf[0..avail_len].copy_from_slice(__input);
14241 Bytes::new(&payload_buf)
14242 } else {
14243 Bytes::new(__input)
14244 };
14245 let mut __struct = Self::default();
14246 __struct.satellites_visible = buf.get_u8();
14247 for v in &mut __struct.satellite_prn {
14248 let val = buf.get_u8();
14249 *v = val;
14250 }
14251 for v in &mut __struct.satellite_used {
14252 let val = buf.get_u8();
14253 *v = val;
14254 }
14255 for v in &mut __struct.satellite_elevation {
14256 let val = buf.get_u8();
14257 *v = val;
14258 }
14259 for v in &mut __struct.satellite_azimuth {
14260 let val = buf.get_u8();
14261 *v = val;
14262 }
14263 for v in &mut __struct.satellite_snr {
14264 let val = buf.get_u8();
14265 *v = val;
14266 }
14267 Ok(__struct)
14268 }
14269 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14270 let mut __tmp = BytesMut::new(bytes);
14271 #[allow(clippy::absurd_extreme_comparisons)]
14272 #[allow(unused_comparisons)]
14273 if __tmp.remaining() < Self::ENCODED_LEN {
14274 panic!(
14275 "buffer is too small (need {} bytes, but got {})",
14276 Self::ENCODED_LEN,
14277 __tmp.remaining(),
14278 )
14279 }
14280 __tmp.put_u8(self.satellites_visible);
14281 for val in &self.satellite_prn {
14282 __tmp.put_u8(*val);
14283 }
14284 for val in &self.satellite_used {
14285 __tmp.put_u8(*val);
14286 }
14287 for val in &self.satellite_elevation {
14288 __tmp.put_u8(*val);
14289 }
14290 for val in &self.satellite_azimuth {
14291 __tmp.put_u8(*val);
14292 }
14293 for val in &self.satellite_snr {
14294 __tmp.put_u8(*val);
14295 }
14296 if matches!(version, MavlinkVersion::V2) {
14297 let len = __tmp.len();
14298 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14299 } else {
14300 __tmp.len()
14301 }
14302 }
14303}
14304#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
14305#[doc = ""]
14306#[doc = "ID: 0"]
14307#[derive(Debug, Clone, PartialEq)]
14308#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14309#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14310pub struct HEARTBEAT_DATA {
14311 #[doc = "A bitfield for use for autopilot-specific flags"]
14312 pub custom_mode: u32,
14313 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
14314 pub mavtype: MavType,
14315 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14316 pub autopilot: MavAutopilot,
14317 #[doc = "System mode bitmap."]
14318 pub base_mode: MavModeFlag,
14319 #[doc = "System status flag."]
14320 pub system_status: MavState,
14321 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
14322 pub mavlink_version: u8,
14323}
14324impl HEARTBEAT_DATA {
14325 pub const ENCODED_LEN: usize = 9usize;
14326 pub const DEFAULT: Self = Self {
14327 custom_mode: 0_u32,
14328 mavtype: MavType::DEFAULT,
14329 autopilot: MavAutopilot::DEFAULT,
14330 base_mode: MavModeFlag::DEFAULT,
14331 system_status: MavState::DEFAULT,
14332 mavlink_version: MINOR_MAVLINK_VERSION,
14333 };
14334 #[cfg(feature = "arbitrary")]
14335 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14336 use arbitrary::{Arbitrary, Unstructured};
14337 let mut buf = [0u8; 1024];
14338 rng.fill_bytes(&mut buf);
14339 let mut unstructured = Unstructured::new(&buf);
14340 Self::arbitrary(&mut unstructured).unwrap_or_default()
14341 }
14342}
14343impl Default for HEARTBEAT_DATA {
14344 fn default() -> Self {
14345 Self::DEFAULT.clone()
14346 }
14347}
14348impl MessageData for HEARTBEAT_DATA {
14349 type Message = MavMessage;
14350 const ID: u32 = 0u32;
14351 const NAME: &'static str = "HEARTBEAT";
14352 const EXTRA_CRC: u8 = 50u8;
14353 const ENCODED_LEN: usize = 9usize;
14354 fn deser(
14355 _version: MavlinkVersion,
14356 __input: &[u8],
14357 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14358 let avail_len = __input.len();
14359 let mut payload_buf = [0; Self::ENCODED_LEN];
14360 let mut buf = if avail_len < Self::ENCODED_LEN {
14361 payload_buf[0..avail_len].copy_from_slice(__input);
14362 Bytes::new(&payload_buf)
14363 } else {
14364 Bytes::new(__input)
14365 };
14366 let mut __struct = Self::default();
14367 __struct.custom_mode = buf.get_u32_le();
14368 let tmp = buf.get_u8();
14369 __struct.mavtype =
14370 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14371 enum_type: "MavType",
14372 value: tmp as u32,
14373 })?;
14374 let tmp = buf.get_u8();
14375 __struct.autopilot =
14376 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14377 enum_type: "MavAutopilot",
14378 value: tmp as u32,
14379 })?;
14380 let tmp = buf.get_u8();
14381 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
14382 ::mavlink_core::error::ParserError::InvalidFlag {
14383 flag_type: "MavModeFlag",
14384 value: tmp as u32,
14385 },
14386 )?;
14387 let tmp = buf.get_u8();
14388 __struct.system_status =
14389 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14390 enum_type: "MavState",
14391 value: tmp as u32,
14392 })?;
14393 __struct.mavlink_version = buf.get_u8();
14394 Ok(__struct)
14395 }
14396 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14397 let mut __tmp = BytesMut::new(bytes);
14398 #[allow(clippy::absurd_extreme_comparisons)]
14399 #[allow(unused_comparisons)]
14400 if __tmp.remaining() < Self::ENCODED_LEN {
14401 panic!(
14402 "buffer is too small (need {} bytes, but got {})",
14403 Self::ENCODED_LEN,
14404 __tmp.remaining(),
14405 )
14406 }
14407 __tmp.put_u32_le(self.custom_mode);
14408 __tmp.put_u8(self.mavtype as u8);
14409 __tmp.put_u8(self.autopilot as u8);
14410 __tmp.put_u8(self.base_mode.bits());
14411 __tmp.put_u8(self.system_status as u8);
14412 __tmp.put_u8(self.mavlink_version);
14413 if matches!(version, MavlinkVersion::V2) {
14414 let len = __tmp.len();
14415 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14416 } else {
14417 __tmp.len()
14418 }
14419 }
14420}
14421#[doc = "The IMU readings in SI units in NED body frame."]
14422#[doc = ""]
14423#[doc = "ID: 105"]
14424#[derive(Debug, Clone, PartialEq)]
14425#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14426#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14427pub struct HIGHRES_IMU_DATA {
14428 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14429 pub time_usec: u64,
14430 #[doc = "X acceleration"]
14431 pub xacc: f32,
14432 #[doc = "Y acceleration"]
14433 pub yacc: f32,
14434 #[doc = "Z acceleration"]
14435 pub zacc: f32,
14436 #[doc = "Angular speed around X axis"]
14437 pub xgyro: f32,
14438 #[doc = "Angular speed around Y axis"]
14439 pub ygyro: f32,
14440 #[doc = "Angular speed around Z axis"]
14441 pub zgyro: f32,
14442 #[doc = "X Magnetic field"]
14443 pub xmag: f32,
14444 #[doc = "Y Magnetic field"]
14445 pub ymag: f32,
14446 #[doc = "Z Magnetic field"]
14447 pub zmag: f32,
14448 #[doc = "Absolute pressure"]
14449 pub abs_pressure: f32,
14450 #[doc = "Differential pressure"]
14451 pub diff_pressure: f32,
14452 #[doc = "Altitude calculated from pressure"]
14453 pub pressure_alt: f32,
14454 #[doc = "Temperature"]
14455 pub temperature: f32,
14456 #[doc = "Bitmap for fields that have updated since last message"]
14457 pub fields_updated: HighresImuUpdatedFlags,
14458 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
14459 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14460 pub id: u8,
14461}
14462impl HIGHRES_IMU_DATA {
14463 pub const ENCODED_LEN: usize = 63usize;
14464 pub const DEFAULT: Self = Self {
14465 time_usec: 0_u64,
14466 xacc: 0.0_f32,
14467 yacc: 0.0_f32,
14468 zacc: 0.0_f32,
14469 xgyro: 0.0_f32,
14470 ygyro: 0.0_f32,
14471 zgyro: 0.0_f32,
14472 xmag: 0.0_f32,
14473 ymag: 0.0_f32,
14474 zmag: 0.0_f32,
14475 abs_pressure: 0.0_f32,
14476 diff_pressure: 0.0_f32,
14477 pressure_alt: 0.0_f32,
14478 temperature: 0.0_f32,
14479 fields_updated: HighresImuUpdatedFlags::DEFAULT,
14480 id: 0_u8,
14481 };
14482 #[cfg(feature = "arbitrary")]
14483 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14484 use arbitrary::{Arbitrary, Unstructured};
14485 let mut buf = [0u8; 1024];
14486 rng.fill_bytes(&mut buf);
14487 let mut unstructured = Unstructured::new(&buf);
14488 Self::arbitrary(&mut unstructured).unwrap_or_default()
14489 }
14490}
14491impl Default for HIGHRES_IMU_DATA {
14492 fn default() -> Self {
14493 Self::DEFAULT.clone()
14494 }
14495}
14496impl MessageData for HIGHRES_IMU_DATA {
14497 type Message = MavMessage;
14498 const ID: u32 = 105u32;
14499 const NAME: &'static str = "HIGHRES_IMU";
14500 const EXTRA_CRC: u8 = 93u8;
14501 const ENCODED_LEN: usize = 63usize;
14502 fn deser(
14503 _version: MavlinkVersion,
14504 __input: &[u8],
14505 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14506 let avail_len = __input.len();
14507 let mut payload_buf = [0; Self::ENCODED_LEN];
14508 let mut buf = if avail_len < Self::ENCODED_LEN {
14509 payload_buf[0..avail_len].copy_from_slice(__input);
14510 Bytes::new(&payload_buf)
14511 } else {
14512 Bytes::new(__input)
14513 };
14514 let mut __struct = Self::default();
14515 __struct.time_usec = buf.get_u64_le();
14516 __struct.xacc = buf.get_f32_le();
14517 __struct.yacc = buf.get_f32_le();
14518 __struct.zacc = buf.get_f32_le();
14519 __struct.xgyro = buf.get_f32_le();
14520 __struct.ygyro = buf.get_f32_le();
14521 __struct.zgyro = buf.get_f32_le();
14522 __struct.xmag = buf.get_f32_le();
14523 __struct.ymag = buf.get_f32_le();
14524 __struct.zmag = buf.get_f32_le();
14525 __struct.abs_pressure = buf.get_f32_le();
14526 __struct.diff_pressure = buf.get_f32_le();
14527 __struct.pressure_alt = buf.get_f32_le();
14528 __struct.temperature = buf.get_f32_le();
14529 let tmp = buf.get_u16_le();
14530 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
14531 tmp & HighresImuUpdatedFlags::all().bits(),
14532 )
14533 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14534 flag_type: "HighresImuUpdatedFlags",
14535 value: tmp as u32,
14536 })?;
14537 __struct.id = buf.get_u8();
14538 Ok(__struct)
14539 }
14540 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14541 let mut __tmp = BytesMut::new(bytes);
14542 #[allow(clippy::absurd_extreme_comparisons)]
14543 #[allow(unused_comparisons)]
14544 if __tmp.remaining() < Self::ENCODED_LEN {
14545 panic!(
14546 "buffer is too small (need {} bytes, but got {})",
14547 Self::ENCODED_LEN,
14548 __tmp.remaining(),
14549 )
14550 }
14551 __tmp.put_u64_le(self.time_usec);
14552 __tmp.put_f32_le(self.xacc);
14553 __tmp.put_f32_le(self.yacc);
14554 __tmp.put_f32_le(self.zacc);
14555 __tmp.put_f32_le(self.xgyro);
14556 __tmp.put_f32_le(self.ygyro);
14557 __tmp.put_f32_le(self.zgyro);
14558 __tmp.put_f32_le(self.xmag);
14559 __tmp.put_f32_le(self.ymag);
14560 __tmp.put_f32_le(self.zmag);
14561 __tmp.put_f32_le(self.abs_pressure);
14562 __tmp.put_f32_le(self.diff_pressure);
14563 __tmp.put_f32_le(self.pressure_alt);
14564 __tmp.put_f32_le(self.temperature);
14565 __tmp.put_u16_le(self.fields_updated.bits());
14566 if matches!(version, MavlinkVersion::V2) {
14567 __tmp.put_u8(self.id);
14568 let len = __tmp.len();
14569 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14570 } else {
14571 __tmp.len()
14572 }
14573 }
14574}
14575#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
14576#[doc = "Message appropriate for high latency connections like Iridium."]
14577#[doc = ""]
14578#[doc = "ID: 234"]
14579#[derive(Debug, Clone, PartialEq)]
14580#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14581#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14582pub struct HIGH_LATENCY_DATA {
14583 #[doc = "A bitfield for use for autopilot-specific flags."]
14584 pub custom_mode: u32,
14585 #[doc = "Latitude"]
14586 pub latitude: i32,
14587 #[doc = "Longitude"]
14588 pub longitude: i32,
14589 #[doc = "roll"]
14590 pub roll: i16,
14591 #[doc = "pitch"]
14592 pub pitch: i16,
14593 #[doc = "heading"]
14594 pub heading: u16,
14595 #[doc = "heading setpoint"]
14596 pub heading_sp: i16,
14597 #[doc = "Altitude above mean sea level"]
14598 pub altitude_amsl: i16,
14599 #[doc = "Altitude setpoint relative to the home position"]
14600 pub altitude_sp: i16,
14601 #[doc = "distance to target"]
14602 pub wp_distance: u16,
14603 #[doc = "Bitmap of enabled system modes."]
14604 pub base_mode: MavModeFlag,
14605 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
14606 pub landed_state: MavLandedState,
14607 #[doc = "throttle (percentage)"]
14608 pub throttle: i8,
14609 #[doc = "airspeed"]
14610 pub airspeed: u8,
14611 #[doc = "airspeed setpoint"]
14612 pub airspeed_sp: u8,
14613 #[doc = "groundspeed"]
14614 pub groundspeed: u8,
14615 #[doc = "climb rate"]
14616 pub climb_rate: i8,
14617 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14618 pub gps_nsat: u8,
14619 #[doc = "GPS Fix type."]
14620 pub gps_fix_type: GpsFixType,
14621 #[doc = "Remaining battery (percentage)"]
14622 pub battery_remaining: u8,
14623 #[doc = "Autopilot temperature (degrees C)"]
14624 pub temperature: i8,
14625 #[doc = "Air temperature (degrees C) from airspeed sensor"]
14626 pub temperature_air: i8,
14627 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
14628 pub failsafe: u8,
14629 #[doc = "current waypoint number"]
14630 pub wp_num: u8,
14631}
14632impl HIGH_LATENCY_DATA {
14633 pub const ENCODED_LEN: usize = 40usize;
14634 pub const DEFAULT: Self = Self {
14635 custom_mode: 0_u32,
14636 latitude: 0_i32,
14637 longitude: 0_i32,
14638 roll: 0_i16,
14639 pitch: 0_i16,
14640 heading: 0_u16,
14641 heading_sp: 0_i16,
14642 altitude_amsl: 0_i16,
14643 altitude_sp: 0_i16,
14644 wp_distance: 0_u16,
14645 base_mode: MavModeFlag::DEFAULT,
14646 landed_state: MavLandedState::DEFAULT,
14647 throttle: 0_i8,
14648 airspeed: 0_u8,
14649 airspeed_sp: 0_u8,
14650 groundspeed: 0_u8,
14651 climb_rate: 0_i8,
14652 gps_nsat: 0_u8,
14653 gps_fix_type: GpsFixType::DEFAULT,
14654 battery_remaining: 0_u8,
14655 temperature: 0_i8,
14656 temperature_air: 0_i8,
14657 failsafe: 0_u8,
14658 wp_num: 0_u8,
14659 };
14660 #[cfg(feature = "arbitrary")]
14661 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14662 use arbitrary::{Arbitrary, Unstructured};
14663 let mut buf = [0u8; 1024];
14664 rng.fill_bytes(&mut buf);
14665 let mut unstructured = Unstructured::new(&buf);
14666 Self::arbitrary(&mut unstructured).unwrap_or_default()
14667 }
14668}
14669impl Default for HIGH_LATENCY_DATA {
14670 fn default() -> Self {
14671 Self::DEFAULT.clone()
14672 }
14673}
14674impl MessageData for HIGH_LATENCY_DATA {
14675 type Message = MavMessage;
14676 const ID: u32 = 234u32;
14677 const NAME: &'static str = "HIGH_LATENCY";
14678 const EXTRA_CRC: u8 = 150u8;
14679 const ENCODED_LEN: usize = 40usize;
14680 fn deser(
14681 _version: MavlinkVersion,
14682 __input: &[u8],
14683 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14684 let avail_len = __input.len();
14685 let mut payload_buf = [0; Self::ENCODED_LEN];
14686 let mut buf = if avail_len < Self::ENCODED_LEN {
14687 payload_buf[0..avail_len].copy_from_slice(__input);
14688 Bytes::new(&payload_buf)
14689 } else {
14690 Bytes::new(__input)
14691 };
14692 let mut __struct = Self::default();
14693 __struct.custom_mode = buf.get_u32_le();
14694 __struct.latitude = buf.get_i32_le();
14695 __struct.longitude = buf.get_i32_le();
14696 __struct.roll = buf.get_i16_le();
14697 __struct.pitch = buf.get_i16_le();
14698 __struct.heading = buf.get_u16_le();
14699 __struct.heading_sp = buf.get_i16_le();
14700 __struct.altitude_amsl = buf.get_i16_le();
14701 __struct.altitude_sp = buf.get_i16_le();
14702 __struct.wp_distance = buf.get_u16_le();
14703 let tmp = buf.get_u8();
14704 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
14705 ::mavlink_core::error::ParserError::InvalidFlag {
14706 flag_type: "MavModeFlag",
14707 value: tmp as u32,
14708 },
14709 )?;
14710 let tmp = buf.get_u8();
14711 __struct.landed_state =
14712 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14713 enum_type: "MavLandedState",
14714 value: tmp as u32,
14715 })?;
14716 __struct.throttle = buf.get_i8();
14717 __struct.airspeed = buf.get_u8();
14718 __struct.airspeed_sp = buf.get_u8();
14719 __struct.groundspeed = buf.get_u8();
14720 __struct.climb_rate = buf.get_i8();
14721 __struct.gps_nsat = buf.get_u8();
14722 let tmp = buf.get_u8();
14723 __struct.gps_fix_type =
14724 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14725 enum_type: "GpsFixType",
14726 value: tmp as u32,
14727 })?;
14728 __struct.battery_remaining = buf.get_u8();
14729 __struct.temperature = buf.get_i8();
14730 __struct.temperature_air = buf.get_i8();
14731 __struct.failsafe = buf.get_u8();
14732 __struct.wp_num = buf.get_u8();
14733 Ok(__struct)
14734 }
14735 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14736 let mut __tmp = BytesMut::new(bytes);
14737 #[allow(clippy::absurd_extreme_comparisons)]
14738 #[allow(unused_comparisons)]
14739 if __tmp.remaining() < Self::ENCODED_LEN {
14740 panic!(
14741 "buffer is too small (need {} bytes, but got {})",
14742 Self::ENCODED_LEN,
14743 __tmp.remaining(),
14744 )
14745 }
14746 __tmp.put_u32_le(self.custom_mode);
14747 __tmp.put_i32_le(self.latitude);
14748 __tmp.put_i32_le(self.longitude);
14749 __tmp.put_i16_le(self.roll);
14750 __tmp.put_i16_le(self.pitch);
14751 __tmp.put_u16_le(self.heading);
14752 __tmp.put_i16_le(self.heading_sp);
14753 __tmp.put_i16_le(self.altitude_amsl);
14754 __tmp.put_i16_le(self.altitude_sp);
14755 __tmp.put_u16_le(self.wp_distance);
14756 __tmp.put_u8(self.base_mode.bits());
14757 __tmp.put_u8(self.landed_state as u8);
14758 __tmp.put_i8(self.throttle);
14759 __tmp.put_u8(self.airspeed);
14760 __tmp.put_u8(self.airspeed_sp);
14761 __tmp.put_u8(self.groundspeed);
14762 __tmp.put_i8(self.climb_rate);
14763 __tmp.put_u8(self.gps_nsat);
14764 __tmp.put_u8(self.gps_fix_type as u8);
14765 __tmp.put_u8(self.battery_remaining);
14766 __tmp.put_i8(self.temperature);
14767 __tmp.put_i8(self.temperature_air);
14768 __tmp.put_u8(self.failsafe);
14769 __tmp.put_u8(self.wp_num);
14770 if matches!(version, MavlinkVersion::V2) {
14771 let len = __tmp.len();
14772 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14773 } else {
14774 __tmp.len()
14775 }
14776 }
14777}
14778#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
14779#[doc = ""]
14780#[doc = "ID: 235"]
14781#[derive(Debug, Clone, PartialEq)]
14782#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14783#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14784pub struct HIGH_LATENCY2_DATA {
14785 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
14786 pub timestamp: u32,
14787 #[doc = "Latitude"]
14788 pub latitude: i32,
14789 #[doc = "Longitude"]
14790 pub longitude: i32,
14791 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
14792 pub custom_mode: u16,
14793 #[doc = "Altitude above mean sea level"]
14794 pub altitude: i16,
14795 #[doc = "Altitude setpoint"]
14796 pub target_altitude: i16,
14797 #[doc = "Distance to target waypoint or position"]
14798 pub target_distance: u16,
14799 #[doc = "Current waypoint number"]
14800 pub wp_num: u16,
14801 #[doc = "Bitmap of failure flags."]
14802 pub failure_flags: HlFailureFlag,
14803 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
14804 pub mavtype: MavType,
14805 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14806 pub autopilot: MavAutopilot,
14807 #[doc = "Heading"]
14808 pub heading: u8,
14809 #[doc = "Heading setpoint"]
14810 pub target_heading: u8,
14811 #[doc = "Throttle"]
14812 pub throttle: u8,
14813 #[doc = "Airspeed"]
14814 pub airspeed: u8,
14815 #[doc = "Airspeed setpoint"]
14816 pub airspeed_sp: u8,
14817 #[doc = "Groundspeed"]
14818 pub groundspeed: u8,
14819 #[doc = "Windspeed"]
14820 pub windspeed: u8,
14821 #[doc = "Wind heading"]
14822 pub wind_heading: u8,
14823 #[doc = "Maximum error horizontal position since last message"]
14824 pub eph: u8,
14825 #[doc = "Maximum error vertical position since last message"]
14826 pub epv: u8,
14827 #[doc = "Air temperature"]
14828 pub temperature_air: i8,
14829 #[doc = "Maximum climb rate magnitude since last message"]
14830 pub climb_rate: i8,
14831 #[doc = "Battery level (-1 if field not provided)."]
14832 pub battery: i8,
14833 #[doc = "Field for custom payload."]
14834 pub custom0: i8,
14835 #[doc = "Field for custom payload."]
14836 pub custom1: i8,
14837 #[doc = "Field for custom payload."]
14838 pub custom2: i8,
14839}
14840impl HIGH_LATENCY2_DATA {
14841 pub const ENCODED_LEN: usize = 42usize;
14842 pub const DEFAULT: Self = Self {
14843 timestamp: 0_u32,
14844 latitude: 0_i32,
14845 longitude: 0_i32,
14846 custom_mode: 0_u16,
14847 altitude: 0_i16,
14848 target_altitude: 0_i16,
14849 target_distance: 0_u16,
14850 wp_num: 0_u16,
14851 failure_flags: HlFailureFlag::DEFAULT,
14852 mavtype: MavType::DEFAULT,
14853 autopilot: MavAutopilot::DEFAULT,
14854 heading: 0_u8,
14855 target_heading: 0_u8,
14856 throttle: 0_u8,
14857 airspeed: 0_u8,
14858 airspeed_sp: 0_u8,
14859 groundspeed: 0_u8,
14860 windspeed: 0_u8,
14861 wind_heading: 0_u8,
14862 eph: 0_u8,
14863 epv: 0_u8,
14864 temperature_air: 0_i8,
14865 climb_rate: 0_i8,
14866 battery: 0_i8,
14867 custom0: 0_i8,
14868 custom1: 0_i8,
14869 custom2: 0_i8,
14870 };
14871 #[cfg(feature = "arbitrary")]
14872 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14873 use arbitrary::{Arbitrary, Unstructured};
14874 let mut buf = [0u8; 1024];
14875 rng.fill_bytes(&mut buf);
14876 let mut unstructured = Unstructured::new(&buf);
14877 Self::arbitrary(&mut unstructured).unwrap_or_default()
14878 }
14879}
14880impl Default for HIGH_LATENCY2_DATA {
14881 fn default() -> Self {
14882 Self::DEFAULT.clone()
14883 }
14884}
14885impl MessageData for HIGH_LATENCY2_DATA {
14886 type Message = MavMessage;
14887 const ID: u32 = 235u32;
14888 const NAME: &'static str = "HIGH_LATENCY2";
14889 const EXTRA_CRC: u8 = 179u8;
14890 const ENCODED_LEN: usize = 42usize;
14891 fn deser(
14892 _version: MavlinkVersion,
14893 __input: &[u8],
14894 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14895 let avail_len = __input.len();
14896 let mut payload_buf = [0; Self::ENCODED_LEN];
14897 let mut buf = if avail_len < Self::ENCODED_LEN {
14898 payload_buf[0..avail_len].copy_from_slice(__input);
14899 Bytes::new(&payload_buf)
14900 } else {
14901 Bytes::new(__input)
14902 };
14903 let mut __struct = Self::default();
14904 __struct.timestamp = buf.get_u32_le();
14905 __struct.latitude = buf.get_i32_le();
14906 __struct.longitude = buf.get_i32_le();
14907 __struct.custom_mode = buf.get_u16_le();
14908 __struct.altitude = buf.get_i16_le();
14909 __struct.target_altitude = buf.get_i16_le();
14910 __struct.target_distance = buf.get_u16_le();
14911 __struct.wp_num = buf.get_u16_le();
14912 let tmp = buf.get_u16_le();
14913 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
14914 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14915 flag_type: "HlFailureFlag",
14916 value: tmp as u32,
14917 })?;
14918 let tmp = buf.get_u8();
14919 __struct.mavtype =
14920 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14921 enum_type: "MavType",
14922 value: tmp as u32,
14923 })?;
14924 let tmp = buf.get_u8();
14925 __struct.autopilot =
14926 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14927 enum_type: "MavAutopilot",
14928 value: tmp as u32,
14929 })?;
14930 __struct.heading = buf.get_u8();
14931 __struct.target_heading = buf.get_u8();
14932 __struct.throttle = buf.get_u8();
14933 __struct.airspeed = buf.get_u8();
14934 __struct.airspeed_sp = buf.get_u8();
14935 __struct.groundspeed = buf.get_u8();
14936 __struct.windspeed = buf.get_u8();
14937 __struct.wind_heading = buf.get_u8();
14938 __struct.eph = buf.get_u8();
14939 __struct.epv = buf.get_u8();
14940 __struct.temperature_air = buf.get_i8();
14941 __struct.climb_rate = buf.get_i8();
14942 __struct.battery = buf.get_i8();
14943 __struct.custom0 = buf.get_i8();
14944 __struct.custom1 = buf.get_i8();
14945 __struct.custom2 = buf.get_i8();
14946 Ok(__struct)
14947 }
14948 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14949 let mut __tmp = BytesMut::new(bytes);
14950 #[allow(clippy::absurd_extreme_comparisons)]
14951 #[allow(unused_comparisons)]
14952 if __tmp.remaining() < Self::ENCODED_LEN {
14953 panic!(
14954 "buffer is too small (need {} bytes, but got {})",
14955 Self::ENCODED_LEN,
14956 __tmp.remaining(),
14957 )
14958 }
14959 __tmp.put_u32_le(self.timestamp);
14960 __tmp.put_i32_le(self.latitude);
14961 __tmp.put_i32_le(self.longitude);
14962 __tmp.put_u16_le(self.custom_mode);
14963 __tmp.put_i16_le(self.altitude);
14964 __tmp.put_i16_le(self.target_altitude);
14965 __tmp.put_u16_le(self.target_distance);
14966 __tmp.put_u16_le(self.wp_num);
14967 __tmp.put_u16_le(self.failure_flags.bits());
14968 __tmp.put_u8(self.mavtype as u8);
14969 __tmp.put_u8(self.autopilot as u8);
14970 __tmp.put_u8(self.heading);
14971 __tmp.put_u8(self.target_heading);
14972 __tmp.put_u8(self.throttle);
14973 __tmp.put_u8(self.airspeed);
14974 __tmp.put_u8(self.airspeed_sp);
14975 __tmp.put_u8(self.groundspeed);
14976 __tmp.put_u8(self.windspeed);
14977 __tmp.put_u8(self.wind_heading);
14978 __tmp.put_u8(self.eph);
14979 __tmp.put_u8(self.epv);
14980 __tmp.put_i8(self.temperature_air);
14981 __tmp.put_i8(self.climb_rate);
14982 __tmp.put_i8(self.battery);
14983 __tmp.put_i8(self.custom0);
14984 __tmp.put_i8(self.custom1);
14985 __tmp.put_i8(self.custom2);
14986 if matches!(version, MavlinkVersion::V2) {
14987 let len = __tmp.len();
14988 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14989 } else {
14990 __tmp.len()
14991 }
14992 }
14993}
14994#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
14995#[doc = ""]
14996#[doc = "ID: 93"]
14997#[derive(Debug, Clone, PartialEq)]
14998#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14999#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15000pub struct HIL_ACTUATOR_CONTROLS_DATA {
15001 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15002 pub time_usec: u64,
15003 #[doc = "Flags bitmask."]
15004 pub flags: HilActuatorControlsFlags,
15005 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15006 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15007 pub controls: [f32; 16],
15008 #[doc = "System mode. Includes arming state."]
15009 pub mode: MavModeFlag,
15010}
15011impl HIL_ACTUATOR_CONTROLS_DATA {
15012 pub const ENCODED_LEN: usize = 81usize;
15013 pub const DEFAULT: Self = Self {
15014 time_usec: 0_u64,
15015 flags: HilActuatorControlsFlags::DEFAULT,
15016 controls: [0.0_f32; 16usize],
15017 mode: MavModeFlag::DEFAULT,
15018 };
15019 #[cfg(feature = "arbitrary")]
15020 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15021 use arbitrary::{Arbitrary, Unstructured};
15022 let mut buf = [0u8; 1024];
15023 rng.fill_bytes(&mut buf);
15024 let mut unstructured = Unstructured::new(&buf);
15025 Self::arbitrary(&mut unstructured).unwrap_or_default()
15026 }
15027}
15028impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15029 fn default() -> Self {
15030 Self::DEFAULT.clone()
15031 }
15032}
15033impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15034 type Message = MavMessage;
15035 const ID: u32 = 93u32;
15036 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15037 const EXTRA_CRC: u8 = 47u8;
15038 const ENCODED_LEN: usize = 81usize;
15039 fn deser(
15040 _version: MavlinkVersion,
15041 __input: &[u8],
15042 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15043 let avail_len = __input.len();
15044 let mut payload_buf = [0; Self::ENCODED_LEN];
15045 let mut buf = if avail_len < Self::ENCODED_LEN {
15046 payload_buf[0..avail_len].copy_from_slice(__input);
15047 Bytes::new(&payload_buf)
15048 } else {
15049 Bytes::new(__input)
15050 };
15051 let mut __struct = Self::default();
15052 __struct.time_usec = buf.get_u64_le();
15053 let tmp = buf.get_u64_le();
15054 __struct.flags =
15055 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
15056 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15057 flag_type: "HilActuatorControlsFlags",
15058 value: tmp as u32,
15059 })?;
15060 for v in &mut __struct.controls {
15061 let val = buf.get_f32_le();
15062 *v = val;
15063 }
15064 let tmp = buf.get_u8();
15065 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15066 ::mavlink_core::error::ParserError::InvalidFlag {
15067 flag_type: "MavModeFlag",
15068 value: tmp as u32,
15069 },
15070 )?;
15071 Ok(__struct)
15072 }
15073 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15074 let mut __tmp = BytesMut::new(bytes);
15075 #[allow(clippy::absurd_extreme_comparisons)]
15076 #[allow(unused_comparisons)]
15077 if __tmp.remaining() < Self::ENCODED_LEN {
15078 panic!(
15079 "buffer is too small (need {} bytes, but got {})",
15080 Self::ENCODED_LEN,
15081 __tmp.remaining(),
15082 )
15083 }
15084 __tmp.put_u64_le(self.time_usec);
15085 __tmp.put_u64_le(self.flags.bits());
15086 for val in &self.controls {
15087 __tmp.put_f32_le(*val);
15088 }
15089 __tmp.put_u8(self.mode.bits());
15090 if matches!(version, MavlinkVersion::V2) {
15091 let len = __tmp.len();
15092 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15093 } else {
15094 __tmp.len()
15095 }
15096 }
15097}
15098#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
15099#[doc = ""]
15100#[doc = "ID: 91"]
15101#[derive(Debug, Clone, PartialEq)]
15102#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15103#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15104pub struct HIL_CONTROLS_DATA {
15105 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15106 pub time_usec: u64,
15107 #[doc = "Control output -1 .. 1"]
15108 pub roll_ailerons: f32,
15109 #[doc = "Control output -1 .. 1"]
15110 pub pitch_elevator: f32,
15111 #[doc = "Control output -1 .. 1"]
15112 pub yaw_rudder: f32,
15113 #[doc = "Throttle 0 .. 1"]
15114 pub throttle: f32,
15115 #[doc = "Aux 1, -1 .. 1"]
15116 pub aux1: f32,
15117 #[doc = "Aux 2, -1 .. 1"]
15118 pub aux2: f32,
15119 #[doc = "Aux 3, -1 .. 1"]
15120 pub aux3: f32,
15121 #[doc = "Aux 4, -1 .. 1"]
15122 pub aux4: f32,
15123 #[doc = "System mode."]
15124 pub mode: MavMode,
15125 #[doc = "Navigation mode (MAV_NAV_MODE)"]
15126 pub nav_mode: u8,
15127}
15128impl HIL_CONTROLS_DATA {
15129 pub const ENCODED_LEN: usize = 42usize;
15130 pub const DEFAULT: Self = Self {
15131 time_usec: 0_u64,
15132 roll_ailerons: 0.0_f32,
15133 pitch_elevator: 0.0_f32,
15134 yaw_rudder: 0.0_f32,
15135 throttle: 0.0_f32,
15136 aux1: 0.0_f32,
15137 aux2: 0.0_f32,
15138 aux3: 0.0_f32,
15139 aux4: 0.0_f32,
15140 mode: MavMode::DEFAULT,
15141 nav_mode: 0_u8,
15142 };
15143 #[cfg(feature = "arbitrary")]
15144 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15145 use arbitrary::{Arbitrary, Unstructured};
15146 let mut buf = [0u8; 1024];
15147 rng.fill_bytes(&mut buf);
15148 let mut unstructured = Unstructured::new(&buf);
15149 Self::arbitrary(&mut unstructured).unwrap_or_default()
15150 }
15151}
15152impl Default for HIL_CONTROLS_DATA {
15153 fn default() -> Self {
15154 Self::DEFAULT.clone()
15155 }
15156}
15157impl MessageData for HIL_CONTROLS_DATA {
15158 type Message = MavMessage;
15159 const ID: u32 = 91u32;
15160 const NAME: &'static str = "HIL_CONTROLS";
15161 const EXTRA_CRC: u8 = 63u8;
15162 const ENCODED_LEN: usize = 42usize;
15163 fn deser(
15164 _version: MavlinkVersion,
15165 __input: &[u8],
15166 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15167 let avail_len = __input.len();
15168 let mut payload_buf = [0; Self::ENCODED_LEN];
15169 let mut buf = if avail_len < Self::ENCODED_LEN {
15170 payload_buf[0..avail_len].copy_from_slice(__input);
15171 Bytes::new(&payload_buf)
15172 } else {
15173 Bytes::new(__input)
15174 };
15175 let mut __struct = Self::default();
15176 __struct.time_usec = buf.get_u64_le();
15177 __struct.roll_ailerons = buf.get_f32_le();
15178 __struct.pitch_elevator = buf.get_f32_le();
15179 __struct.yaw_rudder = buf.get_f32_le();
15180 __struct.throttle = buf.get_f32_le();
15181 __struct.aux1 = buf.get_f32_le();
15182 __struct.aux2 = buf.get_f32_le();
15183 __struct.aux3 = buf.get_f32_le();
15184 __struct.aux4 = buf.get_f32_le();
15185 let tmp = buf.get_u8();
15186 __struct.mode =
15187 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15188 enum_type: "MavMode",
15189 value: tmp as u32,
15190 })?;
15191 __struct.nav_mode = buf.get_u8();
15192 Ok(__struct)
15193 }
15194 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15195 let mut __tmp = BytesMut::new(bytes);
15196 #[allow(clippy::absurd_extreme_comparisons)]
15197 #[allow(unused_comparisons)]
15198 if __tmp.remaining() < Self::ENCODED_LEN {
15199 panic!(
15200 "buffer is too small (need {} bytes, but got {})",
15201 Self::ENCODED_LEN,
15202 __tmp.remaining(),
15203 )
15204 }
15205 __tmp.put_u64_le(self.time_usec);
15206 __tmp.put_f32_le(self.roll_ailerons);
15207 __tmp.put_f32_le(self.pitch_elevator);
15208 __tmp.put_f32_le(self.yaw_rudder);
15209 __tmp.put_f32_le(self.throttle);
15210 __tmp.put_f32_le(self.aux1);
15211 __tmp.put_f32_le(self.aux2);
15212 __tmp.put_f32_le(self.aux3);
15213 __tmp.put_f32_le(self.aux4);
15214 __tmp.put_u8(self.mode as u8);
15215 __tmp.put_u8(self.nav_mode);
15216 if matches!(version, MavlinkVersion::V2) {
15217 let len = __tmp.len();
15218 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15219 } else {
15220 __tmp.len()
15221 }
15222 }
15223}
15224#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15225#[doc = ""]
15226#[doc = "ID: 113"]
15227#[derive(Debug, Clone, PartialEq)]
15228#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15229#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15230pub struct HIL_GPS_DATA {
15231 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15232 pub time_usec: u64,
15233 #[doc = "Latitude (WGS84)"]
15234 pub lat: i32,
15235 #[doc = "Longitude (WGS84)"]
15236 pub lon: i32,
15237 #[doc = "Altitude (MSL). Positive for up."]
15238 pub alt: i32,
15239 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15240 pub eph: u16,
15241 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15242 pub epv: u16,
15243 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15244 pub vel: u16,
15245 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15246 pub vn: i16,
15247 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15248 pub ve: i16,
15249 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15250 pub vd: i16,
15251 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15252 pub cog: u16,
15253 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
15254 pub fix_type: u8,
15255 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15256 pub satellites_visible: u8,
15257 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
15258 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15259 pub id: u8,
15260 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15261 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15262 pub yaw: u16,
15263}
15264impl HIL_GPS_DATA {
15265 pub const ENCODED_LEN: usize = 39usize;
15266 pub const DEFAULT: Self = Self {
15267 time_usec: 0_u64,
15268 lat: 0_i32,
15269 lon: 0_i32,
15270 alt: 0_i32,
15271 eph: 0_u16,
15272 epv: 0_u16,
15273 vel: 0_u16,
15274 vn: 0_i16,
15275 ve: 0_i16,
15276 vd: 0_i16,
15277 cog: 0_u16,
15278 fix_type: 0_u8,
15279 satellites_visible: 0_u8,
15280 id: 0_u8,
15281 yaw: 0_u16,
15282 };
15283 #[cfg(feature = "arbitrary")]
15284 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15285 use arbitrary::{Arbitrary, Unstructured};
15286 let mut buf = [0u8; 1024];
15287 rng.fill_bytes(&mut buf);
15288 let mut unstructured = Unstructured::new(&buf);
15289 Self::arbitrary(&mut unstructured).unwrap_or_default()
15290 }
15291}
15292impl Default for HIL_GPS_DATA {
15293 fn default() -> Self {
15294 Self::DEFAULT.clone()
15295 }
15296}
15297impl MessageData for HIL_GPS_DATA {
15298 type Message = MavMessage;
15299 const ID: u32 = 113u32;
15300 const NAME: &'static str = "HIL_GPS";
15301 const EXTRA_CRC: u8 = 124u8;
15302 const ENCODED_LEN: usize = 39usize;
15303 fn deser(
15304 _version: MavlinkVersion,
15305 __input: &[u8],
15306 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15307 let avail_len = __input.len();
15308 let mut payload_buf = [0; Self::ENCODED_LEN];
15309 let mut buf = if avail_len < Self::ENCODED_LEN {
15310 payload_buf[0..avail_len].copy_from_slice(__input);
15311 Bytes::new(&payload_buf)
15312 } else {
15313 Bytes::new(__input)
15314 };
15315 let mut __struct = Self::default();
15316 __struct.time_usec = buf.get_u64_le();
15317 __struct.lat = buf.get_i32_le();
15318 __struct.lon = buf.get_i32_le();
15319 __struct.alt = buf.get_i32_le();
15320 __struct.eph = buf.get_u16_le();
15321 __struct.epv = buf.get_u16_le();
15322 __struct.vel = buf.get_u16_le();
15323 __struct.vn = buf.get_i16_le();
15324 __struct.ve = buf.get_i16_le();
15325 __struct.vd = buf.get_i16_le();
15326 __struct.cog = buf.get_u16_le();
15327 __struct.fix_type = buf.get_u8();
15328 __struct.satellites_visible = buf.get_u8();
15329 __struct.id = buf.get_u8();
15330 __struct.yaw = buf.get_u16_le();
15331 Ok(__struct)
15332 }
15333 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15334 let mut __tmp = BytesMut::new(bytes);
15335 #[allow(clippy::absurd_extreme_comparisons)]
15336 #[allow(unused_comparisons)]
15337 if __tmp.remaining() < Self::ENCODED_LEN {
15338 panic!(
15339 "buffer is too small (need {} bytes, but got {})",
15340 Self::ENCODED_LEN,
15341 __tmp.remaining(),
15342 )
15343 }
15344 __tmp.put_u64_le(self.time_usec);
15345 __tmp.put_i32_le(self.lat);
15346 __tmp.put_i32_le(self.lon);
15347 __tmp.put_i32_le(self.alt);
15348 __tmp.put_u16_le(self.eph);
15349 __tmp.put_u16_le(self.epv);
15350 __tmp.put_u16_le(self.vel);
15351 __tmp.put_i16_le(self.vn);
15352 __tmp.put_i16_le(self.ve);
15353 __tmp.put_i16_le(self.vd);
15354 __tmp.put_u16_le(self.cog);
15355 __tmp.put_u8(self.fix_type);
15356 __tmp.put_u8(self.satellites_visible);
15357 if matches!(version, MavlinkVersion::V2) {
15358 __tmp.put_u8(self.id);
15359 __tmp.put_u16_le(self.yaw);
15360 let len = __tmp.len();
15361 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15362 } else {
15363 __tmp.len()
15364 }
15365 }
15366}
15367#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
15368#[doc = ""]
15369#[doc = "ID: 114"]
15370#[derive(Debug, Clone, PartialEq)]
15371#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15372#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15373pub struct HIL_OPTICAL_FLOW_DATA {
15374 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15375 pub time_usec: u64,
15376 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
15377 pub integration_time_us: u32,
15378 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
15379 pub integrated_x: f32,
15380 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
15381 pub integrated_y: f32,
15382 #[doc = "RH rotation around X axis"]
15383 pub integrated_xgyro: f32,
15384 #[doc = "RH rotation around Y axis"]
15385 pub integrated_ygyro: f32,
15386 #[doc = "RH rotation around Z axis"]
15387 pub integrated_zgyro: f32,
15388 #[doc = "Time since the distance was sampled."]
15389 pub time_delta_distance_us: u32,
15390 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
15391 pub distance: f32,
15392 #[doc = "Temperature"]
15393 pub temperature: i16,
15394 #[doc = "Sensor ID"]
15395 pub sensor_id: u8,
15396 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
15397 pub quality: u8,
15398}
15399impl HIL_OPTICAL_FLOW_DATA {
15400 pub const ENCODED_LEN: usize = 44usize;
15401 pub const DEFAULT: Self = Self {
15402 time_usec: 0_u64,
15403 integration_time_us: 0_u32,
15404 integrated_x: 0.0_f32,
15405 integrated_y: 0.0_f32,
15406 integrated_xgyro: 0.0_f32,
15407 integrated_ygyro: 0.0_f32,
15408 integrated_zgyro: 0.0_f32,
15409 time_delta_distance_us: 0_u32,
15410 distance: 0.0_f32,
15411 temperature: 0_i16,
15412 sensor_id: 0_u8,
15413 quality: 0_u8,
15414 };
15415 #[cfg(feature = "arbitrary")]
15416 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15417 use arbitrary::{Arbitrary, Unstructured};
15418 let mut buf = [0u8; 1024];
15419 rng.fill_bytes(&mut buf);
15420 let mut unstructured = Unstructured::new(&buf);
15421 Self::arbitrary(&mut unstructured).unwrap_or_default()
15422 }
15423}
15424impl Default for HIL_OPTICAL_FLOW_DATA {
15425 fn default() -> Self {
15426 Self::DEFAULT.clone()
15427 }
15428}
15429impl MessageData for HIL_OPTICAL_FLOW_DATA {
15430 type Message = MavMessage;
15431 const ID: u32 = 114u32;
15432 const NAME: &'static str = "HIL_OPTICAL_FLOW";
15433 const EXTRA_CRC: u8 = 237u8;
15434 const ENCODED_LEN: usize = 44usize;
15435 fn deser(
15436 _version: MavlinkVersion,
15437 __input: &[u8],
15438 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15439 let avail_len = __input.len();
15440 let mut payload_buf = [0; Self::ENCODED_LEN];
15441 let mut buf = if avail_len < Self::ENCODED_LEN {
15442 payload_buf[0..avail_len].copy_from_slice(__input);
15443 Bytes::new(&payload_buf)
15444 } else {
15445 Bytes::new(__input)
15446 };
15447 let mut __struct = Self::default();
15448 __struct.time_usec = buf.get_u64_le();
15449 __struct.integration_time_us = buf.get_u32_le();
15450 __struct.integrated_x = buf.get_f32_le();
15451 __struct.integrated_y = buf.get_f32_le();
15452 __struct.integrated_xgyro = buf.get_f32_le();
15453 __struct.integrated_ygyro = buf.get_f32_le();
15454 __struct.integrated_zgyro = buf.get_f32_le();
15455 __struct.time_delta_distance_us = buf.get_u32_le();
15456 __struct.distance = buf.get_f32_le();
15457 __struct.temperature = buf.get_i16_le();
15458 __struct.sensor_id = buf.get_u8();
15459 __struct.quality = buf.get_u8();
15460 Ok(__struct)
15461 }
15462 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15463 let mut __tmp = BytesMut::new(bytes);
15464 #[allow(clippy::absurd_extreme_comparisons)]
15465 #[allow(unused_comparisons)]
15466 if __tmp.remaining() < Self::ENCODED_LEN {
15467 panic!(
15468 "buffer is too small (need {} bytes, but got {})",
15469 Self::ENCODED_LEN,
15470 __tmp.remaining(),
15471 )
15472 }
15473 __tmp.put_u64_le(self.time_usec);
15474 __tmp.put_u32_le(self.integration_time_us);
15475 __tmp.put_f32_le(self.integrated_x);
15476 __tmp.put_f32_le(self.integrated_y);
15477 __tmp.put_f32_le(self.integrated_xgyro);
15478 __tmp.put_f32_le(self.integrated_ygyro);
15479 __tmp.put_f32_le(self.integrated_zgyro);
15480 __tmp.put_u32_le(self.time_delta_distance_us);
15481 __tmp.put_f32_le(self.distance);
15482 __tmp.put_i16_le(self.temperature);
15483 __tmp.put_u8(self.sensor_id);
15484 __tmp.put_u8(self.quality);
15485 if matches!(version, MavlinkVersion::V2) {
15486 let len = __tmp.len();
15487 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15488 } else {
15489 __tmp.len()
15490 }
15491 }
15492}
15493#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
15494#[doc = ""]
15495#[doc = "ID: 92"]
15496#[derive(Debug, Clone, PartialEq)]
15497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15498#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15499pub struct HIL_RC_INPUTS_RAW_DATA {
15500 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15501 pub time_usec: u64,
15502 #[doc = "RC channel 1 value"]
15503 pub chan1_raw: u16,
15504 #[doc = "RC channel 2 value"]
15505 pub chan2_raw: u16,
15506 #[doc = "RC channel 3 value"]
15507 pub chan3_raw: u16,
15508 #[doc = "RC channel 4 value"]
15509 pub chan4_raw: u16,
15510 #[doc = "RC channel 5 value"]
15511 pub chan5_raw: u16,
15512 #[doc = "RC channel 6 value"]
15513 pub chan6_raw: u16,
15514 #[doc = "RC channel 7 value"]
15515 pub chan7_raw: u16,
15516 #[doc = "RC channel 8 value"]
15517 pub chan8_raw: u16,
15518 #[doc = "RC channel 9 value"]
15519 pub chan9_raw: u16,
15520 #[doc = "RC channel 10 value"]
15521 pub chan10_raw: u16,
15522 #[doc = "RC channel 11 value"]
15523 pub chan11_raw: u16,
15524 #[doc = "RC channel 12 value"]
15525 pub chan12_raw: u16,
15526 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
15527 pub rssi: u8,
15528}
15529impl HIL_RC_INPUTS_RAW_DATA {
15530 pub const ENCODED_LEN: usize = 33usize;
15531 pub const DEFAULT: Self = Self {
15532 time_usec: 0_u64,
15533 chan1_raw: 0_u16,
15534 chan2_raw: 0_u16,
15535 chan3_raw: 0_u16,
15536 chan4_raw: 0_u16,
15537 chan5_raw: 0_u16,
15538 chan6_raw: 0_u16,
15539 chan7_raw: 0_u16,
15540 chan8_raw: 0_u16,
15541 chan9_raw: 0_u16,
15542 chan10_raw: 0_u16,
15543 chan11_raw: 0_u16,
15544 chan12_raw: 0_u16,
15545 rssi: 0_u8,
15546 };
15547 #[cfg(feature = "arbitrary")]
15548 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15549 use arbitrary::{Arbitrary, Unstructured};
15550 let mut buf = [0u8; 1024];
15551 rng.fill_bytes(&mut buf);
15552 let mut unstructured = Unstructured::new(&buf);
15553 Self::arbitrary(&mut unstructured).unwrap_or_default()
15554 }
15555}
15556impl Default for HIL_RC_INPUTS_RAW_DATA {
15557 fn default() -> Self {
15558 Self::DEFAULT.clone()
15559 }
15560}
15561impl MessageData for HIL_RC_INPUTS_RAW_DATA {
15562 type Message = MavMessage;
15563 const ID: u32 = 92u32;
15564 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
15565 const EXTRA_CRC: u8 = 54u8;
15566 const ENCODED_LEN: usize = 33usize;
15567 fn deser(
15568 _version: MavlinkVersion,
15569 __input: &[u8],
15570 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15571 let avail_len = __input.len();
15572 let mut payload_buf = [0; Self::ENCODED_LEN];
15573 let mut buf = if avail_len < Self::ENCODED_LEN {
15574 payload_buf[0..avail_len].copy_from_slice(__input);
15575 Bytes::new(&payload_buf)
15576 } else {
15577 Bytes::new(__input)
15578 };
15579 let mut __struct = Self::default();
15580 __struct.time_usec = buf.get_u64_le();
15581 __struct.chan1_raw = buf.get_u16_le();
15582 __struct.chan2_raw = buf.get_u16_le();
15583 __struct.chan3_raw = buf.get_u16_le();
15584 __struct.chan4_raw = buf.get_u16_le();
15585 __struct.chan5_raw = buf.get_u16_le();
15586 __struct.chan6_raw = buf.get_u16_le();
15587 __struct.chan7_raw = buf.get_u16_le();
15588 __struct.chan8_raw = buf.get_u16_le();
15589 __struct.chan9_raw = buf.get_u16_le();
15590 __struct.chan10_raw = buf.get_u16_le();
15591 __struct.chan11_raw = buf.get_u16_le();
15592 __struct.chan12_raw = buf.get_u16_le();
15593 __struct.rssi = buf.get_u8();
15594 Ok(__struct)
15595 }
15596 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15597 let mut __tmp = BytesMut::new(bytes);
15598 #[allow(clippy::absurd_extreme_comparisons)]
15599 #[allow(unused_comparisons)]
15600 if __tmp.remaining() < Self::ENCODED_LEN {
15601 panic!(
15602 "buffer is too small (need {} bytes, but got {})",
15603 Self::ENCODED_LEN,
15604 __tmp.remaining(),
15605 )
15606 }
15607 __tmp.put_u64_le(self.time_usec);
15608 __tmp.put_u16_le(self.chan1_raw);
15609 __tmp.put_u16_le(self.chan2_raw);
15610 __tmp.put_u16_le(self.chan3_raw);
15611 __tmp.put_u16_le(self.chan4_raw);
15612 __tmp.put_u16_le(self.chan5_raw);
15613 __tmp.put_u16_le(self.chan6_raw);
15614 __tmp.put_u16_le(self.chan7_raw);
15615 __tmp.put_u16_le(self.chan8_raw);
15616 __tmp.put_u16_le(self.chan9_raw);
15617 __tmp.put_u16_le(self.chan10_raw);
15618 __tmp.put_u16_le(self.chan11_raw);
15619 __tmp.put_u16_le(self.chan12_raw);
15620 __tmp.put_u8(self.rssi);
15621 if matches!(version, MavlinkVersion::V2) {
15622 let len = __tmp.len();
15623 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15624 } else {
15625 __tmp.len()
15626 }
15627 }
15628}
15629#[doc = "The IMU readings in SI units in NED body frame."]
15630#[doc = ""]
15631#[doc = "ID: 107"]
15632#[derive(Debug, Clone, PartialEq)]
15633#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15634#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15635pub struct HIL_SENSOR_DATA {
15636 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15637 pub time_usec: u64,
15638 #[doc = "X acceleration"]
15639 pub xacc: f32,
15640 #[doc = "Y acceleration"]
15641 pub yacc: f32,
15642 #[doc = "Z acceleration"]
15643 pub zacc: f32,
15644 #[doc = "Angular speed around X axis in body frame"]
15645 pub xgyro: f32,
15646 #[doc = "Angular speed around Y axis in body frame"]
15647 pub ygyro: f32,
15648 #[doc = "Angular speed around Z axis in body frame"]
15649 pub zgyro: f32,
15650 #[doc = "X Magnetic field"]
15651 pub xmag: f32,
15652 #[doc = "Y Magnetic field"]
15653 pub ymag: f32,
15654 #[doc = "Z Magnetic field"]
15655 pub zmag: f32,
15656 #[doc = "Absolute pressure"]
15657 pub abs_pressure: f32,
15658 #[doc = "Differential pressure (airspeed)"]
15659 pub diff_pressure: f32,
15660 #[doc = "Altitude calculated from pressure"]
15661 pub pressure_alt: f32,
15662 #[doc = "Temperature"]
15663 pub temperature: f32,
15664 #[doc = "Bitmap for fields that have updated since last message"]
15665 pub fields_updated: HilSensorUpdatedFlags,
15666 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
15667 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15668 pub id: u8,
15669}
15670impl HIL_SENSOR_DATA {
15671 pub const ENCODED_LEN: usize = 65usize;
15672 pub const DEFAULT: Self = Self {
15673 time_usec: 0_u64,
15674 xacc: 0.0_f32,
15675 yacc: 0.0_f32,
15676 zacc: 0.0_f32,
15677 xgyro: 0.0_f32,
15678 ygyro: 0.0_f32,
15679 zgyro: 0.0_f32,
15680 xmag: 0.0_f32,
15681 ymag: 0.0_f32,
15682 zmag: 0.0_f32,
15683 abs_pressure: 0.0_f32,
15684 diff_pressure: 0.0_f32,
15685 pressure_alt: 0.0_f32,
15686 temperature: 0.0_f32,
15687 fields_updated: HilSensorUpdatedFlags::DEFAULT,
15688 id: 0_u8,
15689 };
15690 #[cfg(feature = "arbitrary")]
15691 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15692 use arbitrary::{Arbitrary, Unstructured};
15693 let mut buf = [0u8; 1024];
15694 rng.fill_bytes(&mut buf);
15695 let mut unstructured = Unstructured::new(&buf);
15696 Self::arbitrary(&mut unstructured).unwrap_or_default()
15697 }
15698}
15699impl Default for HIL_SENSOR_DATA {
15700 fn default() -> Self {
15701 Self::DEFAULT.clone()
15702 }
15703}
15704impl MessageData for HIL_SENSOR_DATA {
15705 type Message = MavMessage;
15706 const ID: u32 = 107u32;
15707 const NAME: &'static str = "HIL_SENSOR";
15708 const EXTRA_CRC: u8 = 108u8;
15709 const ENCODED_LEN: usize = 65usize;
15710 fn deser(
15711 _version: MavlinkVersion,
15712 __input: &[u8],
15713 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15714 let avail_len = __input.len();
15715 let mut payload_buf = [0; Self::ENCODED_LEN];
15716 let mut buf = if avail_len < Self::ENCODED_LEN {
15717 payload_buf[0..avail_len].copy_from_slice(__input);
15718 Bytes::new(&payload_buf)
15719 } else {
15720 Bytes::new(__input)
15721 };
15722 let mut __struct = Self::default();
15723 __struct.time_usec = buf.get_u64_le();
15724 __struct.xacc = buf.get_f32_le();
15725 __struct.yacc = buf.get_f32_le();
15726 __struct.zacc = buf.get_f32_le();
15727 __struct.xgyro = buf.get_f32_le();
15728 __struct.ygyro = buf.get_f32_le();
15729 __struct.zgyro = buf.get_f32_le();
15730 __struct.xmag = buf.get_f32_le();
15731 __struct.ymag = buf.get_f32_le();
15732 __struct.zmag = buf.get_f32_le();
15733 __struct.abs_pressure = buf.get_f32_le();
15734 __struct.diff_pressure = buf.get_f32_le();
15735 __struct.pressure_alt = buf.get_f32_le();
15736 __struct.temperature = buf.get_f32_le();
15737 let tmp = buf.get_u32_le();
15738 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
15739 tmp & HilSensorUpdatedFlags::all().bits(),
15740 )
15741 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15742 flag_type: "HilSensorUpdatedFlags",
15743 value: tmp as u32,
15744 })?;
15745 __struct.id = buf.get_u8();
15746 Ok(__struct)
15747 }
15748 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15749 let mut __tmp = BytesMut::new(bytes);
15750 #[allow(clippy::absurd_extreme_comparisons)]
15751 #[allow(unused_comparisons)]
15752 if __tmp.remaining() < Self::ENCODED_LEN {
15753 panic!(
15754 "buffer is too small (need {} bytes, but got {})",
15755 Self::ENCODED_LEN,
15756 __tmp.remaining(),
15757 )
15758 }
15759 __tmp.put_u64_le(self.time_usec);
15760 __tmp.put_f32_le(self.xacc);
15761 __tmp.put_f32_le(self.yacc);
15762 __tmp.put_f32_le(self.zacc);
15763 __tmp.put_f32_le(self.xgyro);
15764 __tmp.put_f32_le(self.ygyro);
15765 __tmp.put_f32_le(self.zgyro);
15766 __tmp.put_f32_le(self.xmag);
15767 __tmp.put_f32_le(self.ymag);
15768 __tmp.put_f32_le(self.zmag);
15769 __tmp.put_f32_le(self.abs_pressure);
15770 __tmp.put_f32_le(self.diff_pressure);
15771 __tmp.put_f32_le(self.pressure_alt);
15772 __tmp.put_f32_le(self.temperature);
15773 __tmp.put_u32_le(self.fields_updated.bits());
15774 if matches!(version, MavlinkVersion::V2) {
15775 __tmp.put_u8(self.id);
15776 let len = __tmp.len();
15777 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15778 } else {
15779 __tmp.len()
15780 }
15781 }
15782}
15783#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
15784#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
15785#[doc = ""]
15786#[doc = "ID: 90"]
15787#[derive(Debug, Clone, PartialEq)]
15788#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15789#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15790pub struct HIL_STATE_DATA {
15791 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15792 pub time_usec: u64,
15793 #[doc = "Roll angle"]
15794 pub roll: f32,
15795 #[doc = "Pitch angle"]
15796 pub pitch: f32,
15797 #[doc = "Yaw angle"]
15798 pub yaw: f32,
15799 #[doc = "Body frame roll / phi angular speed"]
15800 pub rollspeed: f32,
15801 #[doc = "Body frame pitch / theta angular speed"]
15802 pub pitchspeed: f32,
15803 #[doc = "Body frame yaw / psi angular speed"]
15804 pub yawspeed: f32,
15805 #[doc = "Latitude"]
15806 pub lat: i32,
15807 #[doc = "Longitude"]
15808 pub lon: i32,
15809 #[doc = "Altitude"]
15810 pub alt: i32,
15811 #[doc = "Ground X Speed (Latitude)"]
15812 pub vx: i16,
15813 #[doc = "Ground Y Speed (Longitude)"]
15814 pub vy: i16,
15815 #[doc = "Ground Z Speed (Altitude)"]
15816 pub vz: i16,
15817 #[doc = "X acceleration"]
15818 pub xacc: i16,
15819 #[doc = "Y acceleration"]
15820 pub yacc: i16,
15821 #[doc = "Z acceleration"]
15822 pub zacc: i16,
15823}
15824impl HIL_STATE_DATA {
15825 pub const ENCODED_LEN: usize = 56usize;
15826 pub const DEFAULT: Self = Self {
15827 time_usec: 0_u64,
15828 roll: 0.0_f32,
15829 pitch: 0.0_f32,
15830 yaw: 0.0_f32,
15831 rollspeed: 0.0_f32,
15832 pitchspeed: 0.0_f32,
15833 yawspeed: 0.0_f32,
15834 lat: 0_i32,
15835 lon: 0_i32,
15836 alt: 0_i32,
15837 vx: 0_i16,
15838 vy: 0_i16,
15839 vz: 0_i16,
15840 xacc: 0_i16,
15841 yacc: 0_i16,
15842 zacc: 0_i16,
15843 };
15844 #[cfg(feature = "arbitrary")]
15845 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15846 use arbitrary::{Arbitrary, Unstructured};
15847 let mut buf = [0u8; 1024];
15848 rng.fill_bytes(&mut buf);
15849 let mut unstructured = Unstructured::new(&buf);
15850 Self::arbitrary(&mut unstructured).unwrap_or_default()
15851 }
15852}
15853impl Default for HIL_STATE_DATA {
15854 fn default() -> Self {
15855 Self::DEFAULT.clone()
15856 }
15857}
15858impl MessageData for HIL_STATE_DATA {
15859 type Message = MavMessage;
15860 const ID: u32 = 90u32;
15861 const NAME: &'static str = "HIL_STATE";
15862 const EXTRA_CRC: u8 = 183u8;
15863 const ENCODED_LEN: usize = 56usize;
15864 fn deser(
15865 _version: MavlinkVersion,
15866 __input: &[u8],
15867 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15868 let avail_len = __input.len();
15869 let mut payload_buf = [0; Self::ENCODED_LEN];
15870 let mut buf = if avail_len < Self::ENCODED_LEN {
15871 payload_buf[0..avail_len].copy_from_slice(__input);
15872 Bytes::new(&payload_buf)
15873 } else {
15874 Bytes::new(__input)
15875 };
15876 let mut __struct = Self::default();
15877 __struct.time_usec = buf.get_u64_le();
15878 __struct.roll = buf.get_f32_le();
15879 __struct.pitch = buf.get_f32_le();
15880 __struct.yaw = buf.get_f32_le();
15881 __struct.rollspeed = buf.get_f32_le();
15882 __struct.pitchspeed = buf.get_f32_le();
15883 __struct.yawspeed = buf.get_f32_le();
15884 __struct.lat = buf.get_i32_le();
15885 __struct.lon = buf.get_i32_le();
15886 __struct.alt = buf.get_i32_le();
15887 __struct.vx = buf.get_i16_le();
15888 __struct.vy = buf.get_i16_le();
15889 __struct.vz = buf.get_i16_le();
15890 __struct.xacc = buf.get_i16_le();
15891 __struct.yacc = buf.get_i16_le();
15892 __struct.zacc = buf.get_i16_le();
15893 Ok(__struct)
15894 }
15895 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15896 let mut __tmp = BytesMut::new(bytes);
15897 #[allow(clippy::absurd_extreme_comparisons)]
15898 #[allow(unused_comparisons)]
15899 if __tmp.remaining() < Self::ENCODED_LEN {
15900 panic!(
15901 "buffer is too small (need {} bytes, but got {})",
15902 Self::ENCODED_LEN,
15903 __tmp.remaining(),
15904 )
15905 }
15906 __tmp.put_u64_le(self.time_usec);
15907 __tmp.put_f32_le(self.roll);
15908 __tmp.put_f32_le(self.pitch);
15909 __tmp.put_f32_le(self.yaw);
15910 __tmp.put_f32_le(self.rollspeed);
15911 __tmp.put_f32_le(self.pitchspeed);
15912 __tmp.put_f32_le(self.yawspeed);
15913 __tmp.put_i32_le(self.lat);
15914 __tmp.put_i32_le(self.lon);
15915 __tmp.put_i32_le(self.alt);
15916 __tmp.put_i16_le(self.vx);
15917 __tmp.put_i16_le(self.vy);
15918 __tmp.put_i16_le(self.vz);
15919 __tmp.put_i16_le(self.xacc);
15920 __tmp.put_i16_le(self.yacc);
15921 __tmp.put_i16_le(self.zacc);
15922 if matches!(version, MavlinkVersion::V2) {
15923 let len = __tmp.len();
15924 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15925 } else {
15926 __tmp.len()
15927 }
15928 }
15929}
15930#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
15931#[doc = ""]
15932#[doc = "ID: 115"]
15933#[derive(Debug, Clone, PartialEq)]
15934#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15935#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15936pub struct HIL_STATE_QUATERNION_DATA {
15937 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15938 pub time_usec: u64,
15939 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
15940 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15941 pub attitude_quaternion: [f32; 4],
15942 #[doc = "Body frame roll / phi angular speed"]
15943 pub rollspeed: f32,
15944 #[doc = "Body frame pitch / theta angular speed"]
15945 pub pitchspeed: f32,
15946 #[doc = "Body frame yaw / psi angular speed"]
15947 pub yawspeed: f32,
15948 #[doc = "Latitude"]
15949 pub lat: i32,
15950 #[doc = "Longitude"]
15951 pub lon: i32,
15952 #[doc = "Altitude"]
15953 pub alt: i32,
15954 #[doc = "Ground X Speed (Latitude)"]
15955 pub vx: i16,
15956 #[doc = "Ground Y Speed (Longitude)"]
15957 pub vy: i16,
15958 #[doc = "Ground Z Speed (Altitude)"]
15959 pub vz: i16,
15960 #[doc = "Indicated airspeed"]
15961 pub ind_airspeed: u16,
15962 #[doc = "True airspeed"]
15963 pub true_airspeed: u16,
15964 #[doc = "X acceleration"]
15965 pub xacc: i16,
15966 #[doc = "Y acceleration"]
15967 pub yacc: i16,
15968 #[doc = "Z acceleration"]
15969 pub zacc: i16,
15970}
15971impl HIL_STATE_QUATERNION_DATA {
15972 pub const ENCODED_LEN: usize = 64usize;
15973 pub const DEFAULT: Self = Self {
15974 time_usec: 0_u64,
15975 attitude_quaternion: [0.0_f32; 4usize],
15976 rollspeed: 0.0_f32,
15977 pitchspeed: 0.0_f32,
15978 yawspeed: 0.0_f32,
15979 lat: 0_i32,
15980 lon: 0_i32,
15981 alt: 0_i32,
15982 vx: 0_i16,
15983 vy: 0_i16,
15984 vz: 0_i16,
15985 ind_airspeed: 0_u16,
15986 true_airspeed: 0_u16,
15987 xacc: 0_i16,
15988 yacc: 0_i16,
15989 zacc: 0_i16,
15990 };
15991 #[cfg(feature = "arbitrary")]
15992 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15993 use arbitrary::{Arbitrary, Unstructured};
15994 let mut buf = [0u8; 1024];
15995 rng.fill_bytes(&mut buf);
15996 let mut unstructured = Unstructured::new(&buf);
15997 Self::arbitrary(&mut unstructured).unwrap_or_default()
15998 }
15999}
16000impl Default for HIL_STATE_QUATERNION_DATA {
16001 fn default() -> Self {
16002 Self::DEFAULT.clone()
16003 }
16004}
16005impl MessageData for HIL_STATE_QUATERNION_DATA {
16006 type Message = MavMessage;
16007 const ID: u32 = 115u32;
16008 const NAME: &'static str = "HIL_STATE_QUATERNION";
16009 const EXTRA_CRC: u8 = 4u8;
16010 const ENCODED_LEN: usize = 64usize;
16011 fn deser(
16012 _version: MavlinkVersion,
16013 __input: &[u8],
16014 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16015 let avail_len = __input.len();
16016 let mut payload_buf = [0; Self::ENCODED_LEN];
16017 let mut buf = if avail_len < Self::ENCODED_LEN {
16018 payload_buf[0..avail_len].copy_from_slice(__input);
16019 Bytes::new(&payload_buf)
16020 } else {
16021 Bytes::new(__input)
16022 };
16023 let mut __struct = Self::default();
16024 __struct.time_usec = buf.get_u64_le();
16025 for v in &mut __struct.attitude_quaternion {
16026 let val = buf.get_f32_le();
16027 *v = val;
16028 }
16029 __struct.rollspeed = buf.get_f32_le();
16030 __struct.pitchspeed = buf.get_f32_le();
16031 __struct.yawspeed = buf.get_f32_le();
16032 __struct.lat = buf.get_i32_le();
16033 __struct.lon = buf.get_i32_le();
16034 __struct.alt = buf.get_i32_le();
16035 __struct.vx = buf.get_i16_le();
16036 __struct.vy = buf.get_i16_le();
16037 __struct.vz = buf.get_i16_le();
16038 __struct.ind_airspeed = buf.get_u16_le();
16039 __struct.true_airspeed = buf.get_u16_le();
16040 __struct.xacc = buf.get_i16_le();
16041 __struct.yacc = buf.get_i16_le();
16042 __struct.zacc = buf.get_i16_le();
16043 Ok(__struct)
16044 }
16045 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16046 let mut __tmp = BytesMut::new(bytes);
16047 #[allow(clippy::absurd_extreme_comparisons)]
16048 #[allow(unused_comparisons)]
16049 if __tmp.remaining() < Self::ENCODED_LEN {
16050 panic!(
16051 "buffer is too small (need {} bytes, but got {})",
16052 Self::ENCODED_LEN,
16053 __tmp.remaining(),
16054 )
16055 }
16056 __tmp.put_u64_le(self.time_usec);
16057 for val in &self.attitude_quaternion {
16058 __tmp.put_f32_le(*val);
16059 }
16060 __tmp.put_f32_le(self.rollspeed);
16061 __tmp.put_f32_le(self.pitchspeed);
16062 __tmp.put_f32_le(self.yawspeed);
16063 __tmp.put_i32_le(self.lat);
16064 __tmp.put_i32_le(self.lon);
16065 __tmp.put_i32_le(self.alt);
16066 __tmp.put_i16_le(self.vx);
16067 __tmp.put_i16_le(self.vy);
16068 __tmp.put_i16_le(self.vz);
16069 __tmp.put_u16_le(self.ind_airspeed);
16070 __tmp.put_u16_le(self.true_airspeed);
16071 __tmp.put_i16_le(self.xacc);
16072 __tmp.put_i16_le(self.yacc);
16073 __tmp.put_i16_le(self.zacc);
16074 if matches!(version, MavlinkVersion::V2) {
16075 let len = __tmp.len();
16076 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16077 } else {
16078 __tmp.len()
16079 }
16080 }
16081}
16082#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
16083#[doc = ""]
16084#[doc = "ID: 242"]
16085#[derive(Debug, Clone, PartialEq)]
16086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16087#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16088pub struct HOME_POSITION_DATA {
16089 #[doc = "Latitude (WGS84)"]
16090 pub latitude: i32,
16091 #[doc = "Longitude (WGS84)"]
16092 pub longitude: i32,
16093 #[doc = "Altitude (MSL). Positive for up."]
16094 pub altitude: i32,
16095 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
16096 pub x: f32,
16097 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
16098 pub y: f32,
16099 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
16100 pub z: f32,
16101 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
16102 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16103 pub q: [f32; 4],
16104 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16105 pub approach_x: f32,
16106 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16107 pub approach_y: f32,
16108 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16109 pub approach_z: f32,
16110 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16111 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16112 pub time_usec: u64,
16113}
16114impl HOME_POSITION_DATA {
16115 pub const ENCODED_LEN: usize = 60usize;
16116 pub const DEFAULT: Self = Self {
16117 latitude: 0_i32,
16118 longitude: 0_i32,
16119 altitude: 0_i32,
16120 x: 0.0_f32,
16121 y: 0.0_f32,
16122 z: 0.0_f32,
16123 q: [0.0_f32; 4usize],
16124 approach_x: 0.0_f32,
16125 approach_y: 0.0_f32,
16126 approach_z: 0.0_f32,
16127 time_usec: 0_u64,
16128 };
16129 #[cfg(feature = "arbitrary")]
16130 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16131 use arbitrary::{Arbitrary, Unstructured};
16132 let mut buf = [0u8; 1024];
16133 rng.fill_bytes(&mut buf);
16134 let mut unstructured = Unstructured::new(&buf);
16135 Self::arbitrary(&mut unstructured).unwrap_or_default()
16136 }
16137}
16138impl Default for HOME_POSITION_DATA {
16139 fn default() -> Self {
16140 Self::DEFAULT.clone()
16141 }
16142}
16143impl MessageData for HOME_POSITION_DATA {
16144 type Message = MavMessage;
16145 const ID: u32 = 242u32;
16146 const NAME: &'static str = "HOME_POSITION";
16147 const EXTRA_CRC: u8 = 104u8;
16148 const ENCODED_LEN: usize = 60usize;
16149 fn deser(
16150 _version: MavlinkVersion,
16151 __input: &[u8],
16152 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16153 let avail_len = __input.len();
16154 let mut payload_buf = [0; Self::ENCODED_LEN];
16155 let mut buf = if avail_len < Self::ENCODED_LEN {
16156 payload_buf[0..avail_len].copy_from_slice(__input);
16157 Bytes::new(&payload_buf)
16158 } else {
16159 Bytes::new(__input)
16160 };
16161 let mut __struct = Self::default();
16162 __struct.latitude = buf.get_i32_le();
16163 __struct.longitude = buf.get_i32_le();
16164 __struct.altitude = buf.get_i32_le();
16165 __struct.x = buf.get_f32_le();
16166 __struct.y = buf.get_f32_le();
16167 __struct.z = buf.get_f32_le();
16168 for v in &mut __struct.q {
16169 let val = buf.get_f32_le();
16170 *v = val;
16171 }
16172 __struct.approach_x = buf.get_f32_le();
16173 __struct.approach_y = buf.get_f32_le();
16174 __struct.approach_z = buf.get_f32_le();
16175 __struct.time_usec = buf.get_u64_le();
16176 Ok(__struct)
16177 }
16178 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16179 let mut __tmp = BytesMut::new(bytes);
16180 #[allow(clippy::absurd_extreme_comparisons)]
16181 #[allow(unused_comparisons)]
16182 if __tmp.remaining() < Self::ENCODED_LEN {
16183 panic!(
16184 "buffer is too small (need {} bytes, but got {})",
16185 Self::ENCODED_LEN,
16186 __tmp.remaining(),
16187 )
16188 }
16189 __tmp.put_i32_le(self.latitude);
16190 __tmp.put_i32_le(self.longitude);
16191 __tmp.put_i32_le(self.altitude);
16192 __tmp.put_f32_le(self.x);
16193 __tmp.put_f32_le(self.y);
16194 __tmp.put_f32_le(self.z);
16195 for val in &self.q {
16196 __tmp.put_f32_le(*val);
16197 }
16198 __tmp.put_f32_le(self.approach_x);
16199 __tmp.put_f32_le(self.approach_y);
16200 __tmp.put_f32_le(self.approach_z);
16201 if matches!(version, MavlinkVersion::V2) {
16202 __tmp.put_u64_le(self.time_usec);
16203 let len = __tmp.len();
16204 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16205 } else {
16206 __tmp.len()
16207 }
16208 }
16209}
16210#[doc = "Temperature and humidity from hygrometer."]
16211#[doc = ""]
16212#[doc = "ID: 12920"]
16213#[derive(Debug, Clone, PartialEq)]
16214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16216pub struct HYGROMETER_SENSOR_DATA {
16217 #[doc = "Temperature"]
16218 pub temperature: i16,
16219 #[doc = "Humidity"]
16220 pub humidity: u16,
16221 #[doc = "Hygrometer ID"]
16222 pub id: u8,
16223}
16224impl HYGROMETER_SENSOR_DATA {
16225 pub const ENCODED_LEN: usize = 5usize;
16226 pub const DEFAULT: Self = Self {
16227 temperature: 0_i16,
16228 humidity: 0_u16,
16229 id: 0_u8,
16230 };
16231 #[cfg(feature = "arbitrary")]
16232 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16233 use arbitrary::{Arbitrary, Unstructured};
16234 let mut buf = [0u8; 1024];
16235 rng.fill_bytes(&mut buf);
16236 let mut unstructured = Unstructured::new(&buf);
16237 Self::arbitrary(&mut unstructured).unwrap_or_default()
16238 }
16239}
16240impl Default for HYGROMETER_SENSOR_DATA {
16241 fn default() -> Self {
16242 Self::DEFAULT.clone()
16243 }
16244}
16245impl MessageData for HYGROMETER_SENSOR_DATA {
16246 type Message = MavMessage;
16247 const ID: u32 = 12920u32;
16248 const NAME: &'static str = "HYGROMETER_SENSOR";
16249 const EXTRA_CRC: u8 = 20u8;
16250 const ENCODED_LEN: usize = 5usize;
16251 fn deser(
16252 _version: MavlinkVersion,
16253 __input: &[u8],
16254 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16255 let avail_len = __input.len();
16256 let mut payload_buf = [0; Self::ENCODED_LEN];
16257 let mut buf = if avail_len < Self::ENCODED_LEN {
16258 payload_buf[0..avail_len].copy_from_slice(__input);
16259 Bytes::new(&payload_buf)
16260 } else {
16261 Bytes::new(__input)
16262 };
16263 let mut __struct = Self::default();
16264 __struct.temperature = buf.get_i16_le();
16265 __struct.humidity = buf.get_u16_le();
16266 __struct.id = buf.get_u8();
16267 Ok(__struct)
16268 }
16269 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16270 let mut __tmp = BytesMut::new(bytes);
16271 #[allow(clippy::absurd_extreme_comparisons)]
16272 #[allow(unused_comparisons)]
16273 if __tmp.remaining() < Self::ENCODED_LEN {
16274 panic!(
16275 "buffer is too small (need {} bytes, but got {})",
16276 Self::ENCODED_LEN,
16277 __tmp.remaining(),
16278 )
16279 }
16280 __tmp.put_i16_le(self.temperature);
16281 __tmp.put_u16_le(self.humidity);
16282 __tmp.put_u8(self.id);
16283 if matches!(version, MavlinkVersion::V2) {
16284 let len = __tmp.len();
16285 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16286 } else {
16287 __tmp.len()
16288 }
16289 }
16290}
16291#[doc = "Illuminator status."]
16292#[doc = ""]
16293#[doc = "ID: 440"]
16294#[derive(Debug, Clone, PartialEq)]
16295#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16296#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16297pub struct ILLUMINATOR_STATUS_DATA {
16298 #[doc = "Time since the start-up of the illuminator in ms"]
16299 pub uptime_ms: u32,
16300 #[doc = "Errors"]
16301 pub error_status: IlluminatorErrorFlags,
16302 #[doc = "Illuminator brightness"]
16303 pub brightness: f32,
16304 #[doc = "Illuminator strobing period in seconds"]
16305 pub strobe_period: f32,
16306 #[doc = "Illuminator strobing duty cycle"]
16307 pub strobe_duty_cycle: f32,
16308 #[doc = "Temperature in Celsius"]
16309 pub temp_c: f32,
16310 #[doc = "Minimum strobing period in seconds"]
16311 pub min_strobe_period: f32,
16312 #[doc = "Maximum strobing period in seconds"]
16313 pub max_strobe_period: f32,
16314 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
16315 pub enable: u8,
16316 #[doc = "Supported illuminator modes"]
16317 pub mode_bitmask: IlluminatorMode,
16318 #[doc = "Illuminator mode"]
16319 pub mode: IlluminatorMode,
16320}
16321impl ILLUMINATOR_STATUS_DATA {
16322 pub const ENCODED_LEN: usize = 35usize;
16323 pub const DEFAULT: Self = Self {
16324 uptime_ms: 0_u32,
16325 error_status: IlluminatorErrorFlags::DEFAULT,
16326 brightness: 0.0_f32,
16327 strobe_period: 0.0_f32,
16328 strobe_duty_cycle: 0.0_f32,
16329 temp_c: 0.0_f32,
16330 min_strobe_period: 0.0_f32,
16331 max_strobe_period: 0.0_f32,
16332 enable: 0_u8,
16333 mode_bitmask: IlluminatorMode::DEFAULT,
16334 mode: IlluminatorMode::DEFAULT,
16335 };
16336 #[cfg(feature = "arbitrary")]
16337 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16338 use arbitrary::{Arbitrary, Unstructured};
16339 let mut buf = [0u8; 1024];
16340 rng.fill_bytes(&mut buf);
16341 let mut unstructured = Unstructured::new(&buf);
16342 Self::arbitrary(&mut unstructured).unwrap_or_default()
16343 }
16344}
16345impl Default for ILLUMINATOR_STATUS_DATA {
16346 fn default() -> Self {
16347 Self::DEFAULT.clone()
16348 }
16349}
16350impl MessageData for ILLUMINATOR_STATUS_DATA {
16351 type Message = MavMessage;
16352 const ID: u32 = 440u32;
16353 const NAME: &'static str = "ILLUMINATOR_STATUS";
16354 const EXTRA_CRC: u8 = 66u8;
16355 const ENCODED_LEN: usize = 35usize;
16356 fn deser(
16357 _version: MavlinkVersion,
16358 __input: &[u8],
16359 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16360 let avail_len = __input.len();
16361 let mut payload_buf = [0; Self::ENCODED_LEN];
16362 let mut buf = if avail_len < Self::ENCODED_LEN {
16363 payload_buf[0..avail_len].copy_from_slice(__input);
16364 Bytes::new(&payload_buf)
16365 } else {
16366 Bytes::new(__input)
16367 };
16368 let mut __struct = Self::default();
16369 __struct.uptime_ms = buf.get_u32_le();
16370 let tmp = buf.get_u32_le();
16371 __struct.error_status = IlluminatorErrorFlags::from_bits(
16372 tmp & IlluminatorErrorFlags::all().bits(),
16373 )
16374 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16375 flag_type: "IlluminatorErrorFlags",
16376 value: tmp as u32,
16377 })?;
16378 __struct.brightness = buf.get_f32_le();
16379 __struct.strobe_period = buf.get_f32_le();
16380 __struct.strobe_duty_cycle = buf.get_f32_le();
16381 __struct.temp_c = buf.get_f32_le();
16382 __struct.min_strobe_period = buf.get_f32_le();
16383 __struct.max_strobe_period = buf.get_f32_le();
16384 __struct.enable = buf.get_u8();
16385 let tmp = buf.get_u8();
16386 __struct.mode_bitmask =
16387 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16388 enum_type: "IlluminatorMode",
16389 value: tmp as u32,
16390 })?;
16391 let tmp = buf.get_u8();
16392 __struct.mode =
16393 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16394 enum_type: "IlluminatorMode",
16395 value: tmp as u32,
16396 })?;
16397 Ok(__struct)
16398 }
16399 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16400 let mut __tmp = BytesMut::new(bytes);
16401 #[allow(clippy::absurd_extreme_comparisons)]
16402 #[allow(unused_comparisons)]
16403 if __tmp.remaining() < Self::ENCODED_LEN {
16404 panic!(
16405 "buffer is too small (need {} bytes, but got {})",
16406 Self::ENCODED_LEN,
16407 __tmp.remaining(),
16408 )
16409 }
16410 __tmp.put_u32_le(self.uptime_ms);
16411 __tmp.put_u32_le(self.error_status.bits());
16412 __tmp.put_f32_le(self.brightness);
16413 __tmp.put_f32_le(self.strobe_period);
16414 __tmp.put_f32_le(self.strobe_duty_cycle);
16415 __tmp.put_f32_le(self.temp_c);
16416 __tmp.put_f32_le(self.min_strobe_period);
16417 __tmp.put_f32_le(self.max_strobe_period);
16418 __tmp.put_u8(self.enable);
16419 __tmp.put_u8(self.mode_bitmask as u8);
16420 __tmp.put_u8(self.mode as u8);
16421 if matches!(version, MavlinkVersion::V2) {
16422 let len = __tmp.len();
16423 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16424 } else {
16425 __tmp.len()
16426 }
16427 }
16428}
16429#[doc = "Status of the Iridium SBD link."]
16430#[doc = ""]
16431#[doc = "ID: 335"]
16432#[derive(Debug, Clone, PartialEq)]
16433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16434#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16435pub struct ISBD_LINK_STATUS_DATA {
16436 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16437 pub timestamp: u64,
16438 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16439 pub last_heartbeat: u64,
16440 #[doc = "Number of failed SBD sessions."]
16441 pub failed_sessions: u16,
16442 #[doc = "Number of successful SBD sessions."]
16443 pub successful_sessions: u16,
16444 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
16445 pub signal_quality: u8,
16446 #[doc = "1: Ring call pending, 0: No call pending."]
16447 pub ring_pending: u8,
16448 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
16449 pub tx_session_pending: u8,
16450 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
16451 pub rx_session_pending: u8,
16452}
16453impl ISBD_LINK_STATUS_DATA {
16454 pub const ENCODED_LEN: usize = 24usize;
16455 pub const DEFAULT: Self = Self {
16456 timestamp: 0_u64,
16457 last_heartbeat: 0_u64,
16458 failed_sessions: 0_u16,
16459 successful_sessions: 0_u16,
16460 signal_quality: 0_u8,
16461 ring_pending: 0_u8,
16462 tx_session_pending: 0_u8,
16463 rx_session_pending: 0_u8,
16464 };
16465 #[cfg(feature = "arbitrary")]
16466 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16467 use arbitrary::{Arbitrary, Unstructured};
16468 let mut buf = [0u8; 1024];
16469 rng.fill_bytes(&mut buf);
16470 let mut unstructured = Unstructured::new(&buf);
16471 Self::arbitrary(&mut unstructured).unwrap_or_default()
16472 }
16473}
16474impl Default for ISBD_LINK_STATUS_DATA {
16475 fn default() -> Self {
16476 Self::DEFAULT.clone()
16477 }
16478}
16479impl MessageData for ISBD_LINK_STATUS_DATA {
16480 type Message = MavMessage;
16481 const ID: u32 = 335u32;
16482 const NAME: &'static str = "ISBD_LINK_STATUS";
16483 const EXTRA_CRC: u8 = 225u8;
16484 const ENCODED_LEN: usize = 24usize;
16485 fn deser(
16486 _version: MavlinkVersion,
16487 __input: &[u8],
16488 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16489 let avail_len = __input.len();
16490 let mut payload_buf = [0; Self::ENCODED_LEN];
16491 let mut buf = if avail_len < Self::ENCODED_LEN {
16492 payload_buf[0..avail_len].copy_from_slice(__input);
16493 Bytes::new(&payload_buf)
16494 } else {
16495 Bytes::new(__input)
16496 };
16497 let mut __struct = Self::default();
16498 __struct.timestamp = buf.get_u64_le();
16499 __struct.last_heartbeat = buf.get_u64_le();
16500 __struct.failed_sessions = buf.get_u16_le();
16501 __struct.successful_sessions = buf.get_u16_le();
16502 __struct.signal_quality = buf.get_u8();
16503 __struct.ring_pending = buf.get_u8();
16504 __struct.tx_session_pending = buf.get_u8();
16505 __struct.rx_session_pending = buf.get_u8();
16506 Ok(__struct)
16507 }
16508 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16509 let mut __tmp = BytesMut::new(bytes);
16510 #[allow(clippy::absurd_extreme_comparisons)]
16511 #[allow(unused_comparisons)]
16512 if __tmp.remaining() < Self::ENCODED_LEN {
16513 panic!(
16514 "buffer is too small (need {} bytes, but got {})",
16515 Self::ENCODED_LEN,
16516 __tmp.remaining(),
16517 )
16518 }
16519 __tmp.put_u64_le(self.timestamp);
16520 __tmp.put_u64_le(self.last_heartbeat);
16521 __tmp.put_u16_le(self.failed_sessions);
16522 __tmp.put_u16_le(self.successful_sessions);
16523 __tmp.put_u8(self.signal_quality);
16524 __tmp.put_u8(self.ring_pending);
16525 __tmp.put_u8(self.tx_session_pending);
16526 __tmp.put_u8(self.rx_session_pending);
16527 if matches!(version, MavlinkVersion::V2) {
16528 let len = __tmp.len();
16529 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16530 } else {
16531 __tmp.len()
16532 }
16533 }
16534}
16535#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
16536#[doc = ""]
16537#[doc = "ID: 149"]
16538#[derive(Debug, Clone, PartialEq)]
16539#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16540#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16541pub struct LANDING_TARGET_DATA {
16542 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16543 pub time_usec: u64,
16544 #[doc = "X-axis angular offset of the target from the center of the image"]
16545 pub angle_x: f32,
16546 #[doc = "Y-axis angular offset of the target from the center of the image"]
16547 pub angle_y: f32,
16548 #[doc = "Distance to the target from the vehicle"]
16549 pub distance: f32,
16550 #[doc = "Size of target along x-axis"]
16551 pub size_x: f32,
16552 #[doc = "Size of target along y-axis"]
16553 pub size_y: f32,
16554 #[doc = "The ID of the target if multiple targets are present"]
16555 pub target_num: u8,
16556 #[doc = "Coordinate frame used for following fields."]
16557 pub frame: MavFrame,
16558 #[doc = "X Position of the landing target in MAV_FRAME"]
16559 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16560 pub x: f32,
16561 #[doc = "Y Position of the landing target in MAV_FRAME"]
16562 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16563 pub y: f32,
16564 #[doc = "Z Position of the landing target in MAV_FRAME"]
16565 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16566 pub z: f32,
16567 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
16568 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16569 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16570 pub q: [f32; 4],
16571 #[doc = "Type of landing target"]
16572 #[cfg_attr(feature = "serde", serde(default))]
16573 pub mavtype: LandingTargetType,
16574 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
16575 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16576 pub position_valid: u8,
16577}
16578impl LANDING_TARGET_DATA {
16579 pub const ENCODED_LEN: usize = 60usize;
16580 pub const DEFAULT: Self = Self {
16581 time_usec: 0_u64,
16582 angle_x: 0.0_f32,
16583 angle_y: 0.0_f32,
16584 distance: 0.0_f32,
16585 size_x: 0.0_f32,
16586 size_y: 0.0_f32,
16587 target_num: 0_u8,
16588 frame: MavFrame::DEFAULT,
16589 x: 0.0_f32,
16590 y: 0.0_f32,
16591 z: 0.0_f32,
16592 q: [0.0_f32; 4usize],
16593 mavtype: LandingTargetType::DEFAULT,
16594 position_valid: 0_u8,
16595 };
16596 #[cfg(feature = "arbitrary")]
16597 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16598 use arbitrary::{Arbitrary, Unstructured};
16599 let mut buf = [0u8; 1024];
16600 rng.fill_bytes(&mut buf);
16601 let mut unstructured = Unstructured::new(&buf);
16602 Self::arbitrary(&mut unstructured).unwrap_or_default()
16603 }
16604}
16605impl Default for LANDING_TARGET_DATA {
16606 fn default() -> Self {
16607 Self::DEFAULT.clone()
16608 }
16609}
16610impl MessageData for LANDING_TARGET_DATA {
16611 type Message = MavMessage;
16612 const ID: u32 = 149u32;
16613 const NAME: &'static str = "LANDING_TARGET";
16614 const EXTRA_CRC: u8 = 200u8;
16615 const ENCODED_LEN: usize = 60usize;
16616 fn deser(
16617 _version: MavlinkVersion,
16618 __input: &[u8],
16619 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16620 let avail_len = __input.len();
16621 let mut payload_buf = [0; Self::ENCODED_LEN];
16622 let mut buf = if avail_len < Self::ENCODED_LEN {
16623 payload_buf[0..avail_len].copy_from_slice(__input);
16624 Bytes::new(&payload_buf)
16625 } else {
16626 Bytes::new(__input)
16627 };
16628 let mut __struct = Self::default();
16629 __struct.time_usec = buf.get_u64_le();
16630 __struct.angle_x = buf.get_f32_le();
16631 __struct.angle_y = buf.get_f32_le();
16632 __struct.distance = buf.get_f32_le();
16633 __struct.size_x = buf.get_f32_le();
16634 __struct.size_y = buf.get_f32_le();
16635 __struct.target_num = buf.get_u8();
16636 let tmp = buf.get_u8();
16637 __struct.frame =
16638 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16639 enum_type: "MavFrame",
16640 value: tmp as u32,
16641 })?;
16642 __struct.x = buf.get_f32_le();
16643 __struct.y = buf.get_f32_le();
16644 __struct.z = buf.get_f32_le();
16645 for v in &mut __struct.q {
16646 let val = buf.get_f32_le();
16647 *v = val;
16648 }
16649 let tmp = buf.get_u8();
16650 __struct.mavtype =
16651 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16652 enum_type: "LandingTargetType",
16653 value: tmp as u32,
16654 })?;
16655 __struct.position_valid = buf.get_u8();
16656 Ok(__struct)
16657 }
16658 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16659 let mut __tmp = BytesMut::new(bytes);
16660 #[allow(clippy::absurd_extreme_comparisons)]
16661 #[allow(unused_comparisons)]
16662 if __tmp.remaining() < Self::ENCODED_LEN {
16663 panic!(
16664 "buffer is too small (need {} bytes, but got {})",
16665 Self::ENCODED_LEN,
16666 __tmp.remaining(),
16667 )
16668 }
16669 __tmp.put_u64_le(self.time_usec);
16670 __tmp.put_f32_le(self.angle_x);
16671 __tmp.put_f32_le(self.angle_y);
16672 __tmp.put_f32_le(self.distance);
16673 __tmp.put_f32_le(self.size_x);
16674 __tmp.put_f32_le(self.size_y);
16675 __tmp.put_u8(self.target_num);
16676 __tmp.put_u8(self.frame as u8);
16677 if matches!(version, MavlinkVersion::V2) {
16678 __tmp.put_f32_le(self.x);
16679 __tmp.put_f32_le(self.y);
16680 __tmp.put_f32_le(self.z);
16681 for val in &self.q {
16682 __tmp.put_f32_le(*val);
16683 }
16684 __tmp.put_u8(self.mavtype as u8);
16685 __tmp.put_u8(self.position_valid);
16686 let len = __tmp.len();
16687 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16688 } else {
16689 __tmp.len()
16690 }
16691 }
16692}
16693#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
16694#[doc = ""]
16695#[doc = "ID: 8"]
16696#[derive(Debug, Clone, PartialEq)]
16697#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16698#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16699pub struct LINK_NODE_STATUS_DATA {
16700 #[doc = "Timestamp (time since system boot)."]
16701 pub timestamp: u64,
16702 #[doc = "Transmit rate"]
16703 pub tx_rate: u32,
16704 #[doc = "Receive rate"]
16705 pub rx_rate: u32,
16706 #[doc = "Messages sent"]
16707 pub messages_sent: u32,
16708 #[doc = "Messages received (estimated from counting seq)"]
16709 pub messages_received: u32,
16710 #[doc = "Messages lost (estimated from counting seq)"]
16711 pub messages_lost: u32,
16712 #[doc = "Number of bytes that could not be parsed correctly."]
16713 pub rx_parse_err: u16,
16714 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
16715 pub tx_overflows: u16,
16716 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
16717 pub rx_overflows: u16,
16718 #[doc = "Remaining free transmit buffer space"]
16719 pub tx_buf: u8,
16720 #[doc = "Remaining free receive buffer space"]
16721 pub rx_buf: u8,
16722}
16723impl LINK_NODE_STATUS_DATA {
16724 pub const ENCODED_LEN: usize = 36usize;
16725 pub const DEFAULT: Self = Self {
16726 timestamp: 0_u64,
16727 tx_rate: 0_u32,
16728 rx_rate: 0_u32,
16729 messages_sent: 0_u32,
16730 messages_received: 0_u32,
16731 messages_lost: 0_u32,
16732 rx_parse_err: 0_u16,
16733 tx_overflows: 0_u16,
16734 rx_overflows: 0_u16,
16735 tx_buf: 0_u8,
16736 rx_buf: 0_u8,
16737 };
16738 #[cfg(feature = "arbitrary")]
16739 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16740 use arbitrary::{Arbitrary, Unstructured};
16741 let mut buf = [0u8; 1024];
16742 rng.fill_bytes(&mut buf);
16743 let mut unstructured = Unstructured::new(&buf);
16744 Self::arbitrary(&mut unstructured).unwrap_or_default()
16745 }
16746}
16747impl Default for LINK_NODE_STATUS_DATA {
16748 fn default() -> Self {
16749 Self::DEFAULT.clone()
16750 }
16751}
16752impl MessageData for LINK_NODE_STATUS_DATA {
16753 type Message = MavMessage;
16754 const ID: u32 = 8u32;
16755 const NAME: &'static str = "LINK_NODE_STATUS";
16756 const EXTRA_CRC: u8 = 117u8;
16757 const ENCODED_LEN: usize = 36usize;
16758 fn deser(
16759 _version: MavlinkVersion,
16760 __input: &[u8],
16761 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16762 let avail_len = __input.len();
16763 let mut payload_buf = [0; Self::ENCODED_LEN];
16764 let mut buf = if avail_len < Self::ENCODED_LEN {
16765 payload_buf[0..avail_len].copy_from_slice(__input);
16766 Bytes::new(&payload_buf)
16767 } else {
16768 Bytes::new(__input)
16769 };
16770 let mut __struct = Self::default();
16771 __struct.timestamp = buf.get_u64_le();
16772 __struct.tx_rate = buf.get_u32_le();
16773 __struct.rx_rate = buf.get_u32_le();
16774 __struct.messages_sent = buf.get_u32_le();
16775 __struct.messages_received = buf.get_u32_le();
16776 __struct.messages_lost = buf.get_u32_le();
16777 __struct.rx_parse_err = buf.get_u16_le();
16778 __struct.tx_overflows = buf.get_u16_le();
16779 __struct.rx_overflows = buf.get_u16_le();
16780 __struct.tx_buf = buf.get_u8();
16781 __struct.rx_buf = buf.get_u8();
16782 Ok(__struct)
16783 }
16784 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16785 let mut __tmp = BytesMut::new(bytes);
16786 #[allow(clippy::absurd_extreme_comparisons)]
16787 #[allow(unused_comparisons)]
16788 if __tmp.remaining() < Self::ENCODED_LEN {
16789 panic!(
16790 "buffer is too small (need {} bytes, but got {})",
16791 Self::ENCODED_LEN,
16792 __tmp.remaining(),
16793 )
16794 }
16795 __tmp.put_u64_le(self.timestamp);
16796 __tmp.put_u32_le(self.tx_rate);
16797 __tmp.put_u32_le(self.rx_rate);
16798 __tmp.put_u32_le(self.messages_sent);
16799 __tmp.put_u32_le(self.messages_received);
16800 __tmp.put_u32_le(self.messages_lost);
16801 __tmp.put_u16_le(self.rx_parse_err);
16802 __tmp.put_u16_le(self.tx_overflows);
16803 __tmp.put_u16_le(self.rx_overflows);
16804 __tmp.put_u8(self.tx_buf);
16805 __tmp.put_u8(self.rx_buf);
16806 if matches!(version, MavlinkVersion::V2) {
16807 let len = __tmp.len();
16808 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16809 } else {
16810 __tmp.len()
16811 }
16812 }
16813}
16814#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
16815#[doc = ""]
16816#[doc = "ID: 32"]
16817#[derive(Debug, Clone, PartialEq)]
16818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16819#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16820pub struct LOCAL_POSITION_NED_DATA {
16821 #[doc = "Timestamp (time since system boot)."]
16822 pub time_boot_ms: u32,
16823 #[doc = "X Position"]
16824 pub x: f32,
16825 #[doc = "Y Position"]
16826 pub y: f32,
16827 #[doc = "Z Position"]
16828 pub z: f32,
16829 #[doc = "X Speed"]
16830 pub vx: f32,
16831 #[doc = "Y Speed"]
16832 pub vy: f32,
16833 #[doc = "Z Speed"]
16834 pub vz: f32,
16835}
16836impl LOCAL_POSITION_NED_DATA {
16837 pub const ENCODED_LEN: usize = 28usize;
16838 pub const DEFAULT: Self = Self {
16839 time_boot_ms: 0_u32,
16840 x: 0.0_f32,
16841 y: 0.0_f32,
16842 z: 0.0_f32,
16843 vx: 0.0_f32,
16844 vy: 0.0_f32,
16845 vz: 0.0_f32,
16846 };
16847 #[cfg(feature = "arbitrary")]
16848 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16849 use arbitrary::{Arbitrary, Unstructured};
16850 let mut buf = [0u8; 1024];
16851 rng.fill_bytes(&mut buf);
16852 let mut unstructured = Unstructured::new(&buf);
16853 Self::arbitrary(&mut unstructured).unwrap_or_default()
16854 }
16855}
16856impl Default for LOCAL_POSITION_NED_DATA {
16857 fn default() -> Self {
16858 Self::DEFAULT.clone()
16859 }
16860}
16861impl MessageData for LOCAL_POSITION_NED_DATA {
16862 type Message = MavMessage;
16863 const ID: u32 = 32u32;
16864 const NAME: &'static str = "LOCAL_POSITION_NED";
16865 const EXTRA_CRC: u8 = 185u8;
16866 const ENCODED_LEN: usize = 28usize;
16867 fn deser(
16868 _version: MavlinkVersion,
16869 __input: &[u8],
16870 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16871 let avail_len = __input.len();
16872 let mut payload_buf = [0; Self::ENCODED_LEN];
16873 let mut buf = if avail_len < Self::ENCODED_LEN {
16874 payload_buf[0..avail_len].copy_from_slice(__input);
16875 Bytes::new(&payload_buf)
16876 } else {
16877 Bytes::new(__input)
16878 };
16879 let mut __struct = Self::default();
16880 __struct.time_boot_ms = buf.get_u32_le();
16881 __struct.x = buf.get_f32_le();
16882 __struct.y = buf.get_f32_le();
16883 __struct.z = buf.get_f32_le();
16884 __struct.vx = buf.get_f32_le();
16885 __struct.vy = buf.get_f32_le();
16886 __struct.vz = buf.get_f32_le();
16887 Ok(__struct)
16888 }
16889 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16890 let mut __tmp = BytesMut::new(bytes);
16891 #[allow(clippy::absurd_extreme_comparisons)]
16892 #[allow(unused_comparisons)]
16893 if __tmp.remaining() < Self::ENCODED_LEN {
16894 panic!(
16895 "buffer is too small (need {} bytes, but got {})",
16896 Self::ENCODED_LEN,
16897 __tmp.remaining(),
16898 )
16899 }
16900 __tmp.put_u32_le(self.time_boot_ms);
16901 __tmp.put_f32_le(self.x);
16902 __tmp.put_f32_le(self.y);
16903 __tmp.put_f32_le(self.z);
16904 __tmp.put_f32_le(self.vx);
16905 __tmp.put_f32_le(self.vy);
16906 __tmp.put_f32_le(self.vz);
16907 if matches!(version, MavlinkVersion::V2) {
16908 let len = __tmp.len();
16909 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16910 } else {
16911 __tmp.len()
16912 }
16913 }
16914}
16915#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
16916#[doc = ""]
16917#[doc = "ID: 64"]
16918#[derive(Debug, Clone, PartialEq)]
16919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16921pub struct LOCAL_POSITION_NED_COV_DATA {
16922 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16923 pub time_usec: u64,
16924 #[doc = "X Position"]
16925 pub x: f32,
16926 #[doc = "Y Position"]
16927 pub y: f32,
16928 #[doc = "Z Position"]
16929 pub z: f32,
16930 #[doc = "X Speed"]
16931 pub vx: f32,
16932 #[doc = "Y Speed"]
16933 pub vy: f32,
16934 #[doc = "Z Speed"]
16935 pub vz: f32,
16936 #[doc = "X Acceleration"]
16937 pub ax: f32,
16938 #[doc = "Y Acceleration"]
16939 pub ay: f32,
16940 #[doc = "Z Acceleration"]
16941 pub az: f32,
16942 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
16943 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16944 pub covariance: [f32; 45],
16945 #[doc = "Class id of the estimator this estimate originated from."]
16946 pub estimator_type: MavEstimatorType,
16947}
16948impl LOCAL_POSITION_NED_COV_DATA {
16949 pub const ENCODED_LEN: usize = 225usize;
16950 pub const DEFAULT: Self = Self {
16951 time_usec: 0_u64,
16952 x: 0.0_f32,
16953 y: 0.0_f32,
16954 z: 0.0_f32,
16955 vx: 0.0_f32,
16956 vy: 0.0_f32,
16957 vz: 0.0_f32,
16958 ax: 0.0_f32,
16959 ay: 0.0_f32,
16960 az: 0.0_f32,
16961 covariance: [0.0_f32; 45usize],
16962 estimator_type: MavEstimatorType::DEFAULT,
16963 };
16964 #[cfg(feature = "arbitrary")]
16965 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16966 use arbitrary::{Arbitrary, Unstructured};
16967 let mut buf = [0u8; 1024];
16968 rng.fill_bytes(&mut buf);
16969 let mut unstructured = Unstructured::new(&buf);
16970 Self::arbitrary(&mut unstructured).unwrap_or_default()
16971 }
16972}
16973impl Default for LOCAL_POSITION_NED_COV_DATA {
16974 fn default() -> Self {
16975 Self::DEFAULT.clone()
16976 }
16977}
16978impl MessageData for LOCAL_POSITION_NED_COV_DATA {
16979 type Message = MavMessage;
16980 const ID: u32 = 64u32;
16981 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
16982 const EXTRA_CRC: u8 = 191u8;
16983 const ENCODED_LEN: usize = 225usize;
16984 fn deser(
16985 _version: MavlinkVersion,
16986 __input: &[u8],
16987 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16988 let avail_len = __input.len();
16989 let mut payload_buf = [0; Self::ENCODED_LEN];
16990 let mut buf = if avail_len < Self::ENCODED_LEN {
16991 payload_buf[0..avail_len].copy_from_slice(__input);
16992 Bytes::new(&payload_buf)
16993 } else {
16994 Bytes::new(__input)
16995 };
16996 let mut __struct = Self::default();
16997 __struct.time_usec = buf.get_u64_le();
16998 __struct.x = buf.get_f32_le();
16999 __struct.y = buf.get_f32_le();
17000 __struct.z = buf.get_f32_le();
17001 __struct.vx = buf.get_f32_le();
17002 __struct.vy = buf.get_f32_le();
17003 __struct.vz = buf.get_f32_le();
17004 __struct.ax = buf.get_f32_le();
17005 __struct.ay = buf.get_f32_le();
17006 __struct.az = buf.get_f32_le();
17007 for v in &mut __struct.covariance {
17008 let val = buf.get_f32_le();
17009 *v = val;
17010 }
17011 let tmp = buf.get_u8();
17012 __struct.estimator_type =
17013 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17014 enum_type: "MavEstimatorType",
17015 value: tmp as u32,
17016 })?;
17017 Ok(__struct)
17018 }
17019 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17020 let mut __tmp = BytesMut::new(bytes);
17021 #[allow(clippy::absurd_extreme_comparisons)]
17022 #[allow(unused_comparisons)]
17023 if __tmp.remaining() < Self::ENCODED_LEN {
17024 panic!(
17025 "buffer is too small (need {} bytes, but got {})",
17026 Self::ENCODED_LEN,
17027 __tmp.remaining(),
17028 )
17029 }
17030 __tmp.put_u64_le(self.time_usec);
17031 __tmp.put_f32_le(self.x);
17032 __tmp.put_f32_le(self.y);
17033 __tmp.put_f32_le(self.z);
17034 __tmp.put_f32_le(self.vx);
17035 __tmp.put_f32_le(self.vy);
17036 __tmp.put_f32_le(self.vz);
17037 __tmp.put_f32_le(self.ax);
17038 __tmp.put_f32_le(self.ay);
17039 __tmp.put_f32_le(self.az);
17040 for val in &self.covariance {
17041 __tmp.put_f32_le(*val);
17042 }
17043 __tmp.put_u8(self.estimator_type as u8);
17044 if matches!(version, MavlinkVersion::V2) {
17045 let len = __tmp.len();
17046 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17047 } else {
17048 __tmp.len()
17049 }
17050 }
17051}
17052#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17053#[doc = ""]
17054#[doc = "ID: 89"]
17055#[derive(Debug, Clone, PartialEq)]
17056#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17057#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17058pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17059 #[doc = "Timestamp (time since system boot)."]
17060 pub time_boot_ms: u32,
17061 #[doc = "X Position"]
17062 pub x: f32,
17063 #[doc = "Y Position"]
17064 pub y: f32,
17065 #[doc = "Z Position"]
17066 pub z: f32,
17067 #[doc = "Roll"]
17068 pub roll: f32,
17069 #[doc = "Pitch"]
17070 pub pitch: f32,
17071 #[doc = "Yaw"]
17072 pub yaw: f32,
17073}
17074impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17075 pub const ENCODED_LEN: usize = 28usize;
17076 pub const DEFAULT: Self = Self {
17077 time_boot_ms: 0_u32,
17078 x: 0.0_f32,
17079 y: 0.0_f32,
17080 z: 0.0_f32,
17081 roll: 0.0_f32,
17082 pitch: 0.0_f32,
17083 yaw: 0.0_f32,
17084 };
17085 #[cfg(feature = "arbitrary")]
17086 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17087 use arbitrary::{Arbitrary, Unstructured};
17088 let mut buf = [0u8; 1024];
17089 rng.fill_bytes(&mut buf);
17090 let mut unstructured = Unstructured::new(&buf);
17091 Self::arbitrary(&mut unstructured).unwrap_or_default()
17092 }
17093}
17094impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17095 fn default() -> Self {
17096 Self::DEFAULT.clone()
17097 }
17098}
17099impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17100 type Message = MavMessage;
17101 const ID: u32 = 89u32;
17102 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
17103 const EXTRA_CRC: u8 = 231u8;
17104 const ENCODED_LEN: usize = 28usize;
17105 fn deser(
17106 _version: MavlinkVersion,
17107 __input: &[u8],
17108 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17109 let avail_len = __input.len();
17110 let mut payload_buf = [0; Self::ENCODED_LEN];
17111 let mut buf = if avail_len < Self::ENCODED_LEN {
17112 payload_buf[0..avail_len].copy_from_slice(__input);
17113 Bytes::new(&payload_buf)
17114 } else {
17115 Bytes::new(__input)
17116 };
17117 let mut __struct = Self::default();
17118 __struct.time_boot_ms = buf.get_u32_le();
17119 __struct.x = buf.get_f32_le();
17120 __struct.y = buf.get_f32_le();
17121 __struct.z = buf.get_f32_le();
17122 __struct.roll = buf.get_f32_le();
17123 __struct.pitch = buf.get_f32_le();
17124 __struct.yaw = buf.get_f32_le();
17125 Ok(__struct)
17126 }
17127 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17128 let mut __tmp = BytesMut::new(bytes);
17129 #[allow(clippy::absurd_extreme_comparisons)]
17130 #[allow(unused_comparisons)]
17131 if __tmp.remaining() < Self::ENCODED_LEN {
17132 panic!(
17133 "buffer is too small (need {} bytes, but got {})",
17134 Self::ENCODED_LEN,
17135 __tmp.remaining(),
17136 )
17137 }
17138 __tmp.put_u32_le(self.time_boot_ms);
17139 __tmp.put_f32_le(self.x);
17140 __tmp.put_f32_le(self.y);
17141 __tmp.put_f32_le(self.z);
17142 __tmp.put_f32_le(self.roll);
17143 __tmp.put_f32_le(self.pitch);
17144 __tmp.put_f32_le(self.yaw);
17145 if matches!(version, MavlinkVersion::V2) {
17146 let len = __tmp.len();
17147 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17148 } else {
17149 __tmp.len()
17150 }
17151 }
17152}
17153#[doc = "An ack for a LOGGING_DATA_ACKED message."]
17154#[doc = ""]
17155#[doc = "ID: 268"]
17156#[derive(Debug, Clone, PartialEq)]
17157#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17159pub struct LOGGING_ACK_DATA {
17160 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
17161 pub sequence: u16,
17162 #[doc = "system ID of the target"]
17163 pub target_system: u8,
17164 #[doc = "component ID of the target"]
17165 pub target_component: u8,
17166}
17167impl LOGGING_ACK_DATA {
17168 pub const ENCODED_LEN: usize = 4usize;
17169 pub const DEFAULT: Self = Self {
17170 sequence: 0_u16,
17171 target_system: 0_u8,
17172 target_component: 0_u8,
17173 };
17174 #[cfg(feature = "arbitrary")]
17175 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17176 use arbitrary::{Arbitrary, Unstructured};
17177 let mut buf = [0u8; 1024];
17178 rng.fill_bytes(&mut buf);
17179 let mut unstructured = Unstructured::new(&buf);
17180 Self::arbitrary(&mut unstructured).unwrap_or_default()
17181 }
17182}
17183impl Default for LOGGING_ACK_DATA {
17184 fn default() -> Self {
17185 Self::DEFAULT.clone()
17186 }
17187}
17188impl MessageData for LOGGING_ACK_DATA {
17189 type Message = MavMessage;
17190 const ID: u32 = 268u32;
17191 const NAME: &'static str = "LOGGING_ACK";
17192 const EXTRA_CRC: u8 = 14u8;
17193 const ENCODED_LEN: usize = 4usize;
17194 fn deser(
17195 _version: MavlinkVersion,
17196 __input: &[u8],
17197 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17198 let avail_len = __input.len();
17199 let mut payload_buf = [0; Self::ENCODED_LEN];
17200 let mut buf = if avail_len < Self::ENCODED_LEN {
17201 payload_buf[0..avail_len].copy_from_slice(__input);
17202 Bytes::new(&payload_buf)
17203 } else {
17204 Bytes::new(__input)
17205 };
17206 let mut __struct = Self::default();
17207 __struct.sequence = buf.get_u16_le();
17208 __struct.target_system = buf.get_u8();
17209 __struct.target_component = buf.get_u8();
17210 Ok(__struct)
17211 }
17212 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17213 let mut __tmp = BytesMut::new(bytes);
17214 #[allow(clippy::absurd_extreme_comparisons)]
17215 #[allow(unused_comparisons)]
17216 if __tmp.remaining() < Self::ENCODED_LEN {
17217 panic!(
17218 "buffer is too small (need {} bytes, but got {})",
17219 Self::ENCODED_LEN,
17220 __tmp.remaining(),
17221 )
17222 }
17223 __tmp.put_u16_le(self.sequence);
17224 __tmp.put_u8(self.target_system);
17225 __tmp.put_u8(self.target_component);
17226 if matches!(version, MavlinkVersion::V2) {
17227 let len = __tmp.len();
17228 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17229 } else {
17230 __tmp.len()
17231 }
17232 }
17233}
17234#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
17235#[doc = ""]
17236#[doc = "ID: 266"]
17237#[derive(Debug, Clone, PartialEq)]
17238#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17239#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17240pub struct LOGGING_DATA_DATA {
17241 #[doc = "sequence number (can wrap)"]
17242 pub sequence: u16,
17243 #[doc = "system ID of the target"]
17244 pub target_system: u8,
17245 #[doc = "component ID of the target"]
17246 pub target_component: u8,
17247 #[doc = "data length"]
17248 pub length: u8,
17249 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17250 pub first_message_offset: u8,
17251 #[doc = "logged data"]
17252 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17253 pub data: [u8; 249],
17254}
17255impl LOGGING_DATA_DATA {
17256 pub const ENCODED_LEN: usize = 255usize;
17257 pub const DEFAULT: Self = Self {
17258 sequence: 0_u16,
17259 target_system: 0_u8,
17260 target_component: 0_u8,
17261 length: 0_u8,
17262 first_message_offset: 0_u8,
17263 data: [0_u8; 249usize],
17264 };
17265 #[cfg(feature = "arbitrary")]
17266 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17267 use arbitrary::{Arbitrary, Unstructured};
17268 let mut buf = [0u8; 1024];
17269 rng.fill_bytes(&mut buf);
17270 let mut unstructured = Unstructured::new(&buf);
17271 Self::arbitrary(&mut unstructured).unwrap_or_default()
17272 }
17273}
17274impl Default for LOGGING_DATA_DATA {
17275 fn default() -> Self {
17276 Self::DEFAULT.clone()
17277 }
17278}
17279impl MessageData for LOGGING_DATA_DATA {
17280 type Message = MavMessage;
17281 const ID: u32 = 266u32;
17282 const NAME: &'static str = "LOGGING_DATA";
17283 const EXTRA_CRC: u8 = 193u8;
17284 const ENCODED_LEN: usize = 255usize;
17285 fn deser(
17286 _version: MavlinkVersion,
17287 __input: &[u8],
17288 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17289 let avail_len = __input.len();
17290 let mut payload_buf = [0; Self::ENCODED_LEN];
17291 let mut buf = if avail_len < Self::ENCODED_LEN {
17292 payload_buf[0..avail_len].copy_from_slice(__input);
17293 Bytes::new(&payload_buf)
17294 } else {
17295 Bytes::new(__input)
17296 };
17297 let mut __struct = Self::default();
17298 __struct.sequence = buf.get_u16_le();
17299 __struct.target_system = buf.get_u8();
17300 __struct.target_component = buf.get_u8();
17301 __struct.length = buf.get_u8();
17302 __struct.first_message_offset = buf.get_u8();
17303 for v in &mut __struct.data {
17304 let val = buf.get_u8();
17305 *v = val;
17306 }
17307 Ok(__struct)
17308 }
17309 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17310 let mut __tmp = BytesMut::new(bytes);
17311 #[allow(clippy::absurd_extreme_comparisons)]
17312 #[allow(unused_comparisons)]
17313 if __tmp.remaining() < Self::ENCODED_LEN {
17314 panic!(
17315 "buffer is too small (need {} bytes, but got {})",
17316 Self::ENCODED_LEN,
17317 __tmp.remaining(),
17318 )
17319 }
17320 __tmp.put_u16_le(self.sequence);
17321 __tmp.put_u8(self.target_system);
17322 __tmp.put_u8(self.target_component);
17323 __tmp.put_u8(self.length);
17324 __tmp.put_u8(self.first_message_offset);
17325 for val in &self.data {
17326 __tmp.put_u8(*val);
17327 }
17328 if matches!(version, MavlinkVersion::V2) {
17329 let len = __tmp.len();
17330 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17331 } else {
17332 __tmp.len()
17333 }
17334 }
17335}
17336#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
17337#[doc = ""]
17338#[doc = "ID: 267"]
17339#[derive(Debug, Clone, PartialEq)]
17340#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17342pub struct LOGGING_DATA_ACKED_DATA {
17343 #[doc = "sequence number (can wrap)"]
17344 pub sequence: u16,
17345 #[doc = "system ID of the target"]
17346 pub target_system: u8,
17347 #[doc = "component ID of the target"]
17348 pub target_component: u8,
17349 #[doc = "data length"]
17350 pub length: u8,
17351 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17352 pub first_message_offset: u8,
17353 #[doc = "logged data"]
17354 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17355 pub data: [u8; 249],
17356}
17357impl LOGGING_DATA_ACKED_DATA {
17358 pub const ENCODED_LEN: usize = 255usize;
17359 pub const DEFAULT: Self = Self {
17360 sequence: 0_u16,
17361 target_system: 0_u8,
17362 target_component: 0_u8,
17363 length: 0_u8,
17364 first_message_offset: 0_u8,
17365 data: [0_u8; 249usize],
17366 };
17367 #[cfg(feature = "arbitrary")]
17368 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17369 use arbitrary::{Arbitrary, Unstructured};
17370 let mut buf = [0u8; 1024];
17371 rng.fill_bytes(&mut buf);
17372 let mut unstructured = Unstructured::new(&buf);
17373 Self::arbitrary(&mut unstructured).unwrap_or_default()
17374 }
17375}
17376impl Default for LOGGING_DATA_ACKED_DATA {
17377 fn default() -> Self {
17378 Self::DEFAULT.clone()
17379 }
17380}
17381impl MessageData for LOGGING_DATA_ACKED_DATA {
17382 type Message = MavMessage;
17383 const ID: u32 = 267u32;
17384 const NAME: &'static str = "LOGGING_DATA_ACKED";
17385 const EXTRA_CRC: u8 = 35u8;
17386 const ENCODED_LEN: usize = 255usize;
17387 fn deser(
17388 _version: MavlinkVersion,
17389 __input: &[u8],
17390 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17391 let avail_len = __input.len();
17392 let mut payload_buf = [0; Self::ENCODED_LEN];
17393 let mut buf = if avail_len < Self::ENCODED_LEN {
17394 payload_buf[0..avail_len].copy_from_slice(__input);
17395 Bytes::new(&payload_buf)
17396 } else {
17397 Bytes::new(__input)
17398 };
17399 let mut __struct = Self::default();
17400 __struct.sequence = buf.get_u16_le();
17401 __struct.target_system = buf.get_u8();
17402 __struct.target_component = buf.get_u8();
17403 __struct.length = buf.get_u8();
17404 __struct.first_message_offset = buf.get_u8();
17405 for v in &mut __struct.data {
17406 let val = buf.get_u8();
17407 *v = val;
17408 }
17409 Ok(__struct)
17410 }
17411 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17412 let mut __tmp = BytesMut::new(bytes);
17413 #[allow(clippy::absurd_extreme_comparisons)]
17414 #[allow(unused_comparisons)]
17415 if __tmp.remaining() < Self::ENCODED_LEN {
17416 panic!(
17417 "buffer is too small (need {} bytes, but got {})",
17418 Self::ENCODED_LEN,
17419 __tmp.remaining(),
17420 )
17421 }
17422 __tmp.put_u16_le(self.sequence);
17423 __tmp.put_u8(self.target_system);
17424 __tmp.put_u8(self.target_component);
17425 __tmp.put_u8(self.length);
17426 __tmp.put_u8(self.first_message_offset);
17427 for val in &self.data {
17428 __tmp.put_u8(*val);
17429 }
17430 if matches!(version, MavlinkVersion::V2) {
17431 let len = __tmp.len();
17432 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17433 } else {
17434 __tmp.len()
17435 }
17436 }
17437}
17438#[doc = "Reply to LOG_REQUEST_DATA."]
17439#[doc = ""]
17440#[doc = "ID: 120"]
17441#[derive(Debug, Clone, PartialEq)]
17442#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17443#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17444pub struct LOG_DATA_DATA {
17445 #[doc = "Offset into the log"]
17446 pub ofs: u32,
17447 #[doc = "Log id (from LOG_ENTRY reply)"]
17448 pub id: u16,
17449 #[doc = "Number of bytes (zero for end of log)"]
17450 pub count: u8,
17451 #[doc = "log data"]
17452 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17453 pub data: [u8; 90],
17454}
17455impl LOG_DATA_DATA {
17456 pub const ENCODED_LEN: usize = 97usize;
17457 pub const DEFAULT: Self = Self {
17458 ofs: 0_u32,
17459 id: 0_u16,
17460 count: 0_u8,
17461 data: [0_u8; 90usize],
17462 };
17463 #[cfg(feature = "arbitrary")]
17464 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17465 use arbitrary::{Arbitrary, Unstructured};
17466 let mut buf = [0u8; 1024];
17467 rng.fill_bytes(&mut buf);
17468 let mut unstructured = Unstructured::new(&buf);
17469 Self::arbitrary(&mut unstructured).unwrap_or_default()
17470 }
17471}
17472impl Default for LOG_DATA_DATA {
17473 fn default() -> Self {
17474 Self::DEFAULT.clone()
17475 }
17476}
17477impl MessageData for LOG_DATA_DATA {
17478 type Message = MavMessage;
17479 const ID: u32 = 120u32;
17480 const NAME: &'static str = "LOG_DATA";
17481 const EXTRA_CRC: u8 = 134u8;
17482 const ENCODED_LEN: usize = 97usize;
17483 fn deser(
17484 _version: MavlinkVersion,
17485 __input: &[u8],
17486 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17487 let avail_len = __input.len();
17488 let mut payload_buf = [0; Self::ENCODED_LEN];
17489 let mut buf = if avail_len < Self::ENCODED_LEN {
17490 payload_buf[0..avail_len].copy_from_slice(__input);
17491 Bytes::new(&payload_buf)
17492 } else {
17493 Bytes::new(__input)
17494 };
17495 let mut __struct = Self::default();
17496 __struct.ofs = buf.get_u32_le();
17497 __struct.id = buf.get_u16_le();
17498 __struct.count = buf.get_u8();
17499 for v in &mut __struct.data {
17500 let val = buf.get_u8();
17501 *v = val;
17502 }
17503 Ok(__struct)
17504 }
17505 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17506 let mut __tmp = BytesMut::new(bytes);
17507 #[allow(clippy::absurd_extreme_comparisons)]
17508 #[allow(unused_comparisons)]
17509 if __tmp.remaining() < Self::ENCODED_LEN {
17510 panic!(
17511 "buffer is too small (need {} bytes, but got {})",
17512 Self::ENCODED_LEN,
17513 __tmp.remaining(),
17514 )
17515 }
17516 __tmp.put_u32_le(self.ofs);
17517 __tmp.put_u16_le(self.id);
17518 __tmp.put_u8(self.count);
17519 for val in &self.data {
17520 __tmp.put_u8(*val);
17521 }
17522 if matches!(version, MavlinkVersion::V2) {
17523 let len = __tmp.len();
17524 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17525 } else {
17526 __tmp.len()
17527 }
17528 }
17529}
17530#[doc = "Reply to LOG_REQUEST_LIST."]
17531#[doc = ""]
17532#[doc = "ID: 118"]
17533#[derive(Debug, Clone, PartialEq)]
17534#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17535#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17536pub struct LOG_ENTRY_DATA {
17537 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
17538 pub time_utc: u32,
17539 #[doc = "Size of the log (may be approximate)"]
17540 pub size: u32,
17541 #[doc = "Log id"]
17542 pub id: u16,
17543 #[doc = "Total number of logs"]
17544 pub num_logs: u16,
17545 #[doc = "High log number"]
17546 pub last_log_num: u16,
17547}
17548impl LOG_ENTRY_DATA {
17549 pub const ENCODED_LEN: usize = 14usize;
17550 pub const DEFAULT: Self = Self {
17551 time_utc: 0_u32,
17552 size: 0_u32,
17553 id: 0_u16,
17554 num_logs: 0_u16,
17555 last_log_num: 0_u16,
17556 };
17557 #[cfg(feature = "arbitrary")]
17558 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17559 use arbitrary::{Arbitrary, Unstructured};
17560 let mut buf = [0u8; 1024];
17561 rng.fill_bytes(&mut buf);
17562 let mut unstructured = Unstructured::new(&buf);
17563 Self::arbitrary(&mut unstructured).unwrap_or_default()
17564 }
17565}
17566impl Default for LOG_ENTRY_DATA {
17567 fn default() -> Self {
17568 Self::DEFAULT.clone()
17569 }
17570}
17571impl MessageData for LOG_ENTRY_DATA {
17572 type Message = MavMessage;
17573 const ID: u32 = 118u32;
17574 const NAME: &'static str = "LOG_ENTRY";
17575 const EXTRA_CRC: u8 = 56u8;
17576 const ENCODED_LEN: usize = 14usize;
17577 fn deser(
17578 _version: MavlinkVersion,
17579 __input: &[u8],
17580 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17581 let avail_len = __input.len();
17582 let mut payload_buf = [0; Self::ENCODED_LEN];
17583 let mut buf = if avail_len < Self::ENCODED_LEN {
17584 payload_buf[0..avail_len].copy_from_slice(__input);
17585 Bytes::new(&payload_buf)
17586 } else {
17587 Bytes::new(__input)
17588 };
17589 let mut __struct = Self::default();
17590 __struct.time_utc = buf.get_u32_le();
17591 __struct.size = buf.get_u32_le();
17592 __struct.id = buf.get_u16_le();
17593 __struct.num_logs = buf.get_u16_le();
17594 __struct.last_log_num = buf.get_u16_le();
17595 Ok(__struct)
17596 }
17597 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17598 let mut __tmp = BytesMut::new(bytes);
17599 #[allow(clippy::absurd_extreme_comparisons)]
17600 #[allow(unused_comparisons)]
17601 if __tmp.remaining() < Self::ENCODED_LEN {
17602 panic!(
17603 "buffer is too small (need {} bytes, but got {})",
17604 Self::ENCODED_LEN,
17605 __tmp.remaining(),
17606 )
17607 }
17608 __tmp.put_u32_le(self.time_utc);
17609 __tmp.put_u32_le(self.size);
17610 __tmp.put_u16_le(self.id);
17611 __tmp.put_u16_le(self.num_logs);
17612 __tmp.put_u16_le(self.last_log_num);
17613 if matches!(version, MavlinkVersion::V2) {
17614 let len = __tmp.len();
17615 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17616 } else {
17617 __tmp.len()
17618 }
17619 }
17620}
17621#[doc = "Erase all logs."]
17622#[doc = ""]
17623#[doc = "ID: 121"]
17624#[derive(Debug, Clone, PartialEq)]
17625#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17626#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17627pub struct LOG_ERASE_DATA {
17628 #[doc = "System ID"]
17629 pub target_system: u8,
17630 #[doc = "Component ID"]
17631 pub target_component: u8,
17632}
17633impl LOG_ERASE_DATA {
17634 pub const ENCODED_LEN: usize = 2usize;
17635 pub const DEFAULT: Self = Self {
17636 target_system: 0_u8,
17637 target_component: 0_u8,
17638 };
17639 #[cfg(feature = "arbitrary")]
17640 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17641 use arbitrary::{Arbitrary, Unstructured};
17642 let mut buf = [0u8; 1024];
17643 rng.fill_bytes(&mut buf);
17644 let mut unstructured = Unstructured::new(&buf);
17645 Self::arbitrary(&mut unstructured).unwrap_or_default()
17646 }
17647}
17648impl Default for LOG_ERASE_DATA {
17649 fn default() -> Self {
17650 Self::DEFAULT.clone()
17651 }
17652}
17653impl MessageData for LOG_ERASE_DATA {
17654 type Message = MavMessage;
17655 const ID: u32 = 121u32;
17656 const NAME: &'static str = "LOG_ERASE";
17657 const EXTRA_CRC: u8 = 237u8;
17658 const ENCODED_LEN: usize = 2usize;
17659 fn deser(
17660 _version: MavlinkVersion,
17661 __input: &[u8],
17662 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17663 let avail_len = __input.len();
17664 let mut payload_buf = [0; Self::ENCODED_LEN];
17665 let mut buf = if avail_len < Self::ENCODED_LEN {
17666 payload_buf[0..avail_len].copy_from_slice(__input);
17667 Bytes::new(&payload_buf)
17668 } else {
17669 Bytes::new(__input)
17670 };
17671 let mut __struct = Self::default();
17672 __struct.target_system = buf.get_u8();
17673 __struct.target_component = buf.get_u8();
17674 Ok(__struct)
17675 }
17676 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17677 let mut __tmp = BytesMut::new(bytes);
17678 #[allow(clippy::absurd_extreme_comparisons)]
17679 #[allow(unused_comparisons)]
17680 if __tmp.remaining() < Self::ENCODED_LEN {
17681 panic!(
17682 "buffer is too small (need {} bytes, but got {})",
17683 Self::ENCODED_LEN,
17684 __tmp.remaining(),
17685 )
17686 }
17687 __tmp.put_u8(self.target_system);
17688 __tmp.put_u8(self.target_component);
17689 if matches!(version, MavlinkVersion::V2) {
17690 let len = __tmp.len();
17691 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17692 } else {
17693 __tmp.len()
17694 }
17695 }
17696}
17697#[doc = "Request a chunk of a log."]
17698#[doc = ""]
17699#[doc = "ID: 119"]
17700#[derive(Debug, Clone, PartialEq)]
17701#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17702#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17703pub struct LOG_REQUEST_DATA_DATA {
17704 #[doc = "Offset into the log"]
17705 pub ofs: u32,
17706 #[doc = "Number of bytes"]
17707 pub count: u32,
17708 #[doc = "Log id (from LOG_ENTRY reply)"]
17709 pub id: u16,
17710 #[doc = "System ID"]
17711 pub target_system: u8,
17712 #[doc = "Component ID"]
17713 pub target_component: u8,
17714}
17715impl LOG_REQUEST_DATA_DATA {
17716 pub const ENCODED_LEN: usize = 12usize;
17717 pub const DEFAULT: Self = Self {
17718 ofs: 0_u32,
17719 count: 0_u32,
17720 id: 0_u16,
17721 target_system: 0_u8,
17722 target_component: 0_u8,
17723 };
17724 #[cfg(feature = "arbitrary")]
17725 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17726 use arbitrary::{Arbitrary, Unstructured};
17727 let mut buf = [0u8; 1024];
17728 rng.fill_bytes(&mut buf);
17729 let mut unstructured = Unstructured::new(&buf);
17730 Self::arbitrary(&mut unstructured).unwrap_or_default()
17731 }
17732}
17733impl Default for LOG_REQUEST_DATA_DATA {
17734 fn default() -> Self {
17735 Self::DEFAULT.clone()
17736 }
17737}
17738impl MessageData for LOG_REQUEST_DATA_DATA {
17739 type Message = MavMessage;
17740 const ID: u32 = 119u32;
17741 const NAME: &'static str = "LOG_REQUEST_DATA";
17742 const EXTRA_CRC: u8 = 116u8;
17743 const ENCODED_LEN: usize = 12usize;
17744 fn deser(
17745 _version: MavlinkVersion,
17746 __input: &[u8],
17747 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17748 let avail_len = __input.len();
17749 let mut payload_buf = [0; Self::ENCODED_LEN];
17750 let mut buf = if avail_len < Self::ENCODED_LEN {
17751 payload_buf[0..avail_len].copy_from_slice(__input);
17752 Bytes::new(&payload_buf)
17753 } else {
17754 Bytes::new(__input)
17755 };
17756 let mut __struct = Self::default();
17757 __struct.ofs = buf.get_u32_le();
17758 __struct.count = buf.get_u32_le();
17759 __struct.id = buf.get_u16_le();
17760 __struct.target_system = buf.get_u8();
17761 __struct.target_component = buf.get_u8();
17762 Ok(__struct)
17763 }
17764 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17765 let mut __tmp = BytesMut::new(bytes);
17766 #[allow(clippy::absurd_extreme_comparisons)]
17767 #[allow(unused_comparisons)]
17768 if __tmp.remaining() < Self::ENCODED_LEN {
17769 panic!(
17770 "buffer is too small (need {} bytes, but got {})",
17771 Self::ENCODED_LEN,
17772 __tmp.remaining(),
17773 )
17774 }
17775 __tmp.put_u32_le(self.ofs);
17776 __tmp.put_u32_le(self.count);
17777 __tmp.put_u16_le(self.id);
17778 __tmp.put_u8(self.target_system);
17779 __tmp.put_u8(self.target_component);
17780 if matches!(version, MavlinkVersion::V2) {
17781 let len = __tmp.len();
17782 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17783 } else {
17784 __tmp.len()
17785 }
17786 }
17787}
17788#[doc = "Stop log transfer and resume normal logging."]
17789#[doc = ""]
17790#[doc = "ID: 122"]
17791#[derive(Debug, Clone, PartialEq)]
17792#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17793#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17794pub struct LOG_REQUEST_END_DATA {
17795 #[doc = "System ID"]
17796 pub target_system: u8,
17797 #[doc = "Component ID"]
17798 pub target_component: u8,
17799}
17800impl LOG_REQUEST_END_DATA {
17801 pub const ENCODED_LEN: usize = 2usize;
17802 pub const DEFAULT: Self = Self {
17803 target_system: 0_u8,
17804 target_component: 0_u8,
17805 };
17806 #[cfg(feature = "arbitrary")]
17807 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17808 use arbitrary::{Arbitrary, Unstructured};
17809 let mut buf = [0u8; 1024];
17810 rng.fill_bytes(&mut buf);
17811 let mut unstructured = Unstructured::new(&buf);
17812 Self::arbitrary(&mut unstructured).unwrap_or_default()
17813 }
17814}
17815impl Default for LOG_REQUEST_END_DATA {
17816 fn default() -> Self {
17817 Self::DEFAULT.clone()
17818 }
17819}
17820impl MessageData for LOG_REQUEST_END_DATA {
17821 type Message = MavMessage;
17822 const ID: u32 = 122u32;
17823 const NAME: &'static str = "LOG_REQUEST_END";
17824 const EXTRA_CRC: u8 = 203u8;
17825 const ENCODED_LEN: usize = 2usize;
17826 fn deser(
17827 _version: MavlinkVersion,
17828 __input: &[u8],
17829 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17830 let avail_len = __input.len();
17831 let mut payload_buf = [0; Self::ENCODED_LEN];
17832 let mut buf = if avail_len < Self::ENCODED_LEN {
17833 payload_buf[0..avail_len].copy_from_slice(__input);
17834 Bytes::new(&payload_buf)
17835 } else {
17836 Bytes::new(__input)
17837 };
17838 let mut __struct = Self::default();
17839 __struct.target_system = buf.get_u8();
17840 __struct.target_component = buf.get_u8();
17841 Ok(__struct)
17842 }
17843 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17844 let mut __tmp = BytesMut::new(bytes);
17845 #[allow(clippy::absurd_extreme_comparisons)]
17846 #[allow(unused_comparisons)]
17847 if __tmp.remaining() < Self::ENCODED_LEN {
17848 panic!(
17849 "buffer is too small (need {} bytes, but got {})",
17850 Self::ENCODED_LEN,
17851 __tmp.remaining(),
17852 )
17853 }
17854 __tmp.put_u8(self.target_system);
17855 __tmp.put_u8(self.target_component);
17856 if matches!(version, MavlinkVersion::V2) {
17857 let len = __tmp.len();
17858 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17859 } else {
17860 __tmp.len()
17861 }
17862 }
17863}
17864#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
17865#[doc = ""]
17866#[doc = "ID: 117"]
17867#[derive(Debug, Clone, PartialEq)]
17868#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17870pub struct LOG_REQUEST_LIST_DATA {
17871 #[doc = "First log id (0 for first available)"]
17872 pub start: u16,
17873 #[doc = "Last log id (0xffff for last available)"]
17874 pub end: u16,
17875 #[doc = "System ID"]
17876 pub target_system: u8,
17877 #[doc = "Component ID"]
17878 pub target_component: u8,
17879}
17880impl LOG_REQUEST_LIST_DATA {
17881 pub const ENCODED_LEN: usize = 6usize;
17882 pub const DEFAULT: Self = Self {
17883 start: 0_u16,
17884 end: 0_u16,
17885 target_system: 0_u8,
17886 target_component: 0_u8,
17887 };
17888 #[cfg(feature = "arbitrary")]
17889 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17890 use arbitrary::{Arbitrary, Unstructured};
17891 let mut buf = [0u8; 1024];
17892 rng.fill_bytes(&mut buf);
17893 let mut unstructured = Unstructured::new(&buf);
17894 Self::arbitrary(&mut unstructured).unwrap_or_default()
17895 }
17896}
17897impl Default for LOG_REQUEST_LIST_DATA {
17898 fn default() -> Self {
17899 Self::DEFAULT.clone()
17900 }
17901}
17902impl MessageData for LOG_REQUEST_LIST_DATA {
17903 type Message = MavMessage;
17904 const ID: u32 = 117u32;
17905 const NAME: &'static str = "LOG_REQUEST_LIST";
17906 const EXTRA_CRC: u8 = 128u8;
17907 const ENCODED_LEN: usize = 6usize;
17908 fn deser(
17909 _version: MavlinkVersion,
17910 __input: &[u8],
17911 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17912 let avail_len = __input.len();
17913 let mut payload_buf = [0; Self::ENCODED_LEN];
17914 let mut buf = if avail_len < Self::ENCODED_LEN {
17915 payload_buf[0..avail_len].copy_from_slice(__input);
17916 Bytes::new(&payload_buf)
17917 } else {
17918 Bytes::new(__input)
17919 };
17920 let mut __struct = Self::default();
17921 __struct.start = buf.get_u16_le();
17922 __struct.end = buf.get_u16_le();
17923 __struct.target_system = buf.get_u8();
17924 __struct.target_component = buf.get_u8();
17925 Ok(__struct)
17926 }
17927 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17928 let mut __tmp = BytesMut::new(bytes);
17929 #[allow(clippy::absurd_extreme_comparisons)]
17930 #[allow(unused_comparisons)]
17931 if __tmp.remaining() < Self::ENCODED_LEN {
17932 panic!(
17933 "buffer is too small (need {} bytes, but got {})",
17934 Self::ENCODED_LEN,
17935 __tmp.remaining(),
17936 )
17937 }
17938 __tmp.put_u16_le(self.start);
17939 __tmp.put_u16_le(self.end);
17940 __tmp.put_u8(self.target_system);
17941 __tmp.put_u8(self.target_component);
17942 if matches!(version, MavlinkVersion::V2) {
17943 let len = __tmp.len();
17944 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17945 } else {
17946 __tmp.len()
17947 }
17948 }
17949}
17950#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
17951#[doc = ""]
17952#[doc = "ID: 192"]
17953#[derive(Debug, Clone, PartialEq)]
17954#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17955#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17956pub struct MAG_CAL_REPORT_DATA {
17957 #[doc = "RMS milligauss residuals."]
17958 pub fitness: f32,
17959 #[doc = "X offset."]
17960 pub ofs_x: f32,
17961 #[doc = "Y offset."]
17962 pub ofs_y: f32,
17963 #[doc = "Z offset."]
17964 pub ofs_z: f32,
17965 #[doc = "X diagonal (matrix 11)."]
17966 pub diag_x: f32,
17967 #[doc = "Y diagonal (matrix 22)."]
17968 pub diag_y: f32,
17969 #[doc = "Z diagonal (matrix 33)."]
17970 pub diag_z: f32,
17971 #[doc = "X off-diagonal (matrix 12 and 21)."]
17972 pub offdiag_x: f32,
17973 #[doc = "Y off-diagonal (matrix 13 and 31)."]
17974 pub offdiag_y: f32,
17975 #[doc = "Z off-diagonal (matrix 32 and 23)."]
17976 pub offdiag_z: f32,
17977 #[doc = "Compass being calibrated."]
17978 pub compass_id: u8,
17979 #[doc = "Bitmask of compasses being calibrated."]
17980 pub cal_mask: u8,
17981 #[doc = "Calibration Status."]
17982 pub cal_status: MagCalStatus,
17983 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
17984 pub autosaved: u8,
17985 #[doc = "Confidence in orientation (higher is better)."]
17986 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17987 pub orientation_confidence: f32,
17988 #[doc = "orientation before calibration."]
17989 #[cfg_attr(feature = "serde", serde(default))]
17990 pub old_orientation: MavSensorOrientation,
17991 #[doc = "orientation after calibration."]
17992 #[cfg_attr(feature = "serde", serde(default))]
17993 pub new_orientation: MavSensorOrientation,
17994 #[doc = "field radius correction factor"]
17995 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17996 pub scale_factor: f32,
17997}
17998impl MAG_CAL_REPORT_DATA {
17999 pub const ENCODED_LEN: usize = 54usize;
18000 pub const DEFAULT: Self = Self {
18001 fitness: 0.0_f32,
18002 ofs_x: 0.0_f32,
18003 ofs_y: 0.0_f32,
18004 ofs_z: 0.0_f32,
18005 diag_x: 0.0_f32,
18006 diag_y: 0.0_f32,
18007 diag_z: 0.0_f32,
18008 offdiag_x: 0.0_f32,
18009 offdiag_y: 0.0_f32,
18010 offdiag_z: 0.0_f32,
18011 compass_id: 0_u8,
18012 cal_mask: 0_u8,
18013 cal_status: MagCalStatus::DEFAULT,
18014 autosaved: 0_u8,
18015 orientation_confidence: 0.0_f32,
18016 old_orientation: MavSensorOrientation::DEFAULT,
18017 new_orientation: MavSensorOrientation::DEFAULT,
18018 scale_factor: 0.0_f32,
18019 };
18020 #[cfg(feature = "arbitrary")]
18021 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18022 use arbitrary::{Arbitrary, Unstructured};
18023 let mut buf = [0u8; 1024];
18024 rng.fill_bytes(&mut buf);
18025 let mut unstructured = Unstructured::new(&buf);
18026 Self::arbitrary(&mut unstructured).unwrap_or_default()
18027 }
18028}
18029impl Default for MAG_CAL_REPORT_DATA {
18030 fn default() -> Self {
18031 Self::DEFAULT.clone()
18032 }
18033}
18034impl MessageData for MAG_CAL_REPORT_DATA {
18035 type Message = MavMessage;
18036 const ID: u32 = 192u32;
18037 const NAME: &'static str = "MAG_CAL_REPORT";
18038 const EXTRA_CRC: u8 = 36u8;
18039 const ENCODED_LEN: usize = 54usize;
18040 fn deser(
18041 _version: MavlinkVersion,
18042 __input: &[u8],
18043 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18044 let avail_len = __input.len();
18045 let mut payload_buf = [0; Self::ENCODED_LEN];
18046 let mut buf = if avail_len < Self::ENCODED_LEN {
18047 payload_buf[0..avail_len].copy_from_slice(__input);
18048 Bytes::new(&payload_buf)
18049 } else {
18050 Bytes::new(__input)
18051 };
18052 let mut __struct = Self::default();
18053 __struct.fitness = buf.get_f32_le();
18054 __struct.ofs_x = buf.get_f32_le();
18055 __struct.ofs_y = buf.get_f32_le();
18056 __struct.ofs_z = buf.get_f32_le();
18057 __struct.diag_x = buf.get_f32_le();
18058 __struct.diag_y = buf.get_f32_le();
18059 __struct.diag_z = buf.get_f32_le();
18060 __struct.offdiag_x = buf.get_f32_le();
18061 __struct.offdiag_y = buf.get_f32_le();
18062 __struct.offdiag_z = buf.get_f32_le();
18063 __struct.compass_id = buf.get_u8();
18064 __struct.cal_mask = buf.get_u8();
18065 let tmp = buf.get_u8();
18066 __struct.cal_status =
18067 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18068 enum_type: "MagCalStatus",
18069 value: tmp as u32,
18070 })?;
18071 __struct.autosaved = buf.get_u8();
18072 __struct.orientation_confidence = buf.get_f32_le();
18073 let tmp = buf.get_u8();
18074 __struct.old_orientation =
18075 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18076 enum_type: "MavSensorOrientation",
18077 value: tmp as u32,
18078 })?;
18079 let tmp = buf.get_u8();
18080 __struct.new_orientation =
18081 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18082 enum_type: "MavSensorOrientation",
18083 value: tmp as u32,
18084 })?;
18085 __struct.scale_factor = buf.get_f32_le();
18086 Ok(__struct)
18087 }
18088 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18089 let mut __tmp = BytesMut::new(bytes);
18090 #[allow(clippy::absurd_extreme_comparisons)]
18091 #[allow(unused_comparisons)]
18092 if __tmp.remaining() < Self::ENCODED_LEN {
18093 panic!(
18094 "buffer is too small (need {} bytes, but got {})",
18095 Self::ENCODED_LEN,
18096 __tmp.remaining(),
18097 )
18098 }
18099 __tmp.put_f32_le(self.fitness);
18100 __tmp.put_f32_le(self.ofs_x);
18101 __tmp.put_f32_le(self.ofs_y);
18102 __tmp.put_f32_le(self.ofs_z);
18103 __tmp.put_f32_le(self.diag_x);
18104 __tmp.put_f32_le(self.diag_y);
18105 __tmp.put_f32_le(self.diag_z);
18106 __tmp.put_f32_le(self.offdiag_x);
18107 __tmp.put_f32_le(self.offdiag_y);
18108 __tmp.put_f32_le(self.offdiag_z);
18109 __tmp.put_u8(self.compass_id);
18110 __tmp.put_u8(self.cal_mask);
18111 __tmp.put_u8(self.cal_status as u8);
18112 __tmp.put_u8(self.autosaved);
18113 if matches!(version, MavlinkVersion::V2) {
18114 __tmp.put_f32_le(self.orientation_confidence);
18115 __tmp.put_u8(self.old_orientation as u8);
18116 __tmp.put_u8(self.new_orientation as u8);
18117 __tmp.put_f32_le(self.scale_factor);
18118 let len = __tmp.len();
18119 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18120 } else {
18121 __tmp.len()
18122 }
18123 }
18124}
18125#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
18126#[doc = ""]
18127#[doc = "ID: 69"]
18128#[derive(Debug, Clone, PartialEq)]
18129#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18131pub struct MANUAL_CONTROL_DATA {
18132 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
18133 pub x: i16,
18134 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
18135 pub y: i16,
18136 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
18137 pub z: i16,
18138 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
18139 pub r: i16,
18140 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
18141 pub buttons: u16,
18142 #[doc = "The system to be controlled."]
18143 pub target: u8,
18144 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
18145 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18146 pub buttons2: u16,
18147 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
18148 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18149 pub enabled_extensions: u8,
18150 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
18151 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18152 pub s: i16,
18153 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
18154 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18155 pub t: i16,
18156 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
18157 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18158 pub aux1: i16,
18159 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
18160 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18161 pub aux2: i16,
18162 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
18163 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18164 pub aux3: i16,
18165 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
18166 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18167 pub aux4: i16,
18168 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
18169 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18170 pub aux5: i16,
18171 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
18172 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18173 pub aux6: i16,
18174}
18175impl MANUAL_CONTROL_DATA {
18176 pub const ENCODED_LEN: usize = 30usize;
18177 pub const DEFAULT: Self = Self {
18178 x: 0_i16,
18179 y: 0_i16,
18180 z: 0_i16,
18181 r: 0_i16,
18182 buttons: 0_u16,
18183 target: 0_u8,
18184 buttons2: 0_u16,
18185 enabled_extensions: 0_u8,
18186 s: 0_i16,
18187 t: 0_i16,
18188 aux1: 0_i16,
18189 aux2: 0_i16,
18190 aux3: 0_i16,
18191 aux4: 0_i16,
18192 aux5: 0_i16,
18193 aux6: 0_i16,
18194 };
18195 #[cfg(feature = "arbitrary")]
18196 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18197 use arbitrary::{Arbitrary, Unstructured};
18198 let mut buf = [0u8; 1024];
18199 rng.fill_bytes(&mut buf);
18200 let mut unstructured = Unstructured::new(&buf);
18201 Self::arbitrary(&mut unstructured).unwrap_or_default()
18202 }
18203}
18204impl Default for MANUAL_CONTROL_DATA {
18205 fn default() -> Self {
18206 Self::DEFAULT.clone()
18207 }
18208}
18209impl MessageData for MANUAL_CONTROL_DATA {
18210 type Message = MavMessage;
18211 const ID: u32 = 69u32;
18212 const NAME: &'static str = "MANUAL_CONTROL";
18213 const EXTRA_CRC: u8 = 243u8;
18214 const ENCODED_LEN: usize = 30usize;
18215 fn deser(
18216 _version: MavlinkVersion,
18217 __input: &[u8],
18218 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18219 let avail_len = __input.len();
18220 let mut payload_buf = [0; Self::ENCODED_LEN];
18221 let mut buf = if avail_len < Self::ENCODED_LEN {
18222 payload_buf[0..avail_len].copy_from_slice(__input);
18223 Bytes::new(&payload_buf)
18224 } else {
18225 Bytes::new(__input)
18226 };
18227 let mut __struct = Self::default();
18228 __struct.x = buf.get_i16_le();
18229 __struct.y = buf.get_i16_le();
18230 __struct.z = buf.get_i16_le();
18231 __struct.r = buf.get_i16_le();
18232 __struct.buttons = buf.get_u16_le();
18233 __struct.target = buf.get_u8();
18234 __struct.buttons2 = buf.get_u16_le();
18235 __struct.enabled_extensions = buf.get_u8();
18236 __struct.s = buf.get_i16_le();
18237 __struct.t = buf.get_i16_le();
18238 __struct.aux1 = buf.get_i16_le();
18239 __struct.aux2 = buf.get_i16_le();
18240 __struct.aux3 = buf.get_i16_le();
18241 __struct.aux4 = buf.get_i16_le();
18242 __struct.aux5 = buf.get_i16_le();
18243 __struct.aux6 = buf.get_i16_le();
18244 Ok(__struct)
18245 }
18246 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18247 let mut __tmp = BytesMut::new(bytes);
18248 #[allow(clippy::absurd_extreme_comparisons)]
18249 #[allow(unused_comparisons)]
18250 if __tmp.remaining() < Self::ENCODED_LEN {
18251 panic!(
18252 "buffer is too small (need {} bytes, but got {})",
18253 Self::ENCODED_LEN,
18254 __tmp.remaining(),
18255 )
18256 }
18257 __tmp.put_i16_le(self.x);
18258 __tmp.put_i16_le(self.y);
18259 __tmp.put_i16_le(self.z);
18260 __tmp.put_i16_le(self.r);
18261 __tmp.put_u16_le(self.buttons);
18262 __tmp.put_u8(self.target);
18263 if matches!(version, MavlinkVersion::V2) {
18264 __tmp.put_u16_le(self.buttons2);
18265 __tmp.put_u8(self.enabled_extensions);
18266 __tmp.put_i16_le(self.s);
18267 __tmp.put_i16_le(self.t);
18268 __tmp.put_i16_le(self.aux1);
18269 __tmp.put_i16_le(self.aux2);
18270 __tmp.put_i16_le(self.aux3);
18271 __tmp.put_i16_le(self.aux4);
18272 __tmp.put_i16_le(self.aux5);
18273 __tmp.put_i16_le(self.aux6);
18274 let len = __tmp.len();
18275 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18276 } else {
18277 __tmp.len()
18278 }
18279 }
18280}
18281#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
18282#[doc = ""]
18283#[doc = "ID: 81"]
18284#[derive(Debug, Clone, PartialEq)]
18285#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18286#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18287pub struct MANUAL_SETPOINT_DATA {
18288 #[doc = "Timestamp (time since system boot)."]
18289 pub time_boot_ms: u32,
18290 #[doc = "Desired roll rate"]
18291 pub roll: f32,
18292 #[doc = "Desired pitch rate"]
18293 pub pitch: f32,
18294 #[doc = "Desired yaw rate"]
18295 pub yaw: f32,
18296 #[doc = "Collective thrust, normalized to 0 .. 1"]
18297 pub thrust: f32,
18298 #[doc = "Flight mode switch position, 0.. 255"]
18299 pub mode_switch: u8,
18300 #[doc = "Override mode switch position, 0.. 255"]
18301 pub manual_override_switch: u8,
18302}
18303impl MANUAL_SETPOINT_DATA {
18304 pub const ENCODED_LEN: usize = 22usize;
18305 pub const DEFAULT: Self = Self {
18306 time_boot_ms: 0_u32,
18307 roll: 0.0_f32,
18308 pitch: 0.0_f32,
18309 yaw: 0.0_f32,
18310 thrust: 0.0_f32,
18311 mode_switch: 0_u8,
18312 manual_override_switch: 0_u8,
18313 };
18314 #[cfg(feature = "arbitrary")]
18315 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18316 use arbitrary::{Arbitrary, Unstructured};
18317 let mut buf = [0u8; 1024];
18318 rng.fill_bytes(&mut buf);
18319 let mut unstructured = Unstructured::new(&buf);
18320 Self::arbitrary(&mut unstructured).unwrap_or_default()
18321 }
18322}
18323impl Default for MANUAL_SETPOINT_DATA {
18324 fn default() -> Self {
18325 Self::DEFAULT.clone()
18326 }
18327}
18328impl MessageData for MANUAL_SETPOINT_DATA {
18329 type Message = MavMessage;
18330 const ID: u32 = 81u32;
18331 const NAME: &'static str = "MANUAL_SETPOINT";
18332 const EXTRA_CRC: u8 = 106u8;
18333 const ENCODED_LEN: usize = 22usize;
18334 fn deser(
18335 _version: MavlinkVersion,
18336 __input: &[u8],
18337 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18338 let avail_len = __input.len();
18339 let mut payload_buf = [0; Self::ENCODED_LEN];
18340 let mut buf = if avail_len < Self::ENCODED_LEN {
18341 payload_buf[0..avail_len].copy_from_slice(__input);
18342 Bytes::new(&payload_buf)
18343 } else {
18344 Bytes::new(__input)
18345 };
18346 let mut __struct = Self::default();
18347 __struct.time_boot_ms = buf.get_u32_le();
18348 __struct.roll = buf.get_f32_le();
18349 __struct.pitch = buf.get_f32_le();
18350 __struct.yaw = buf.get_f32_le();
18351 __struct.thrust = buf.get_f32_le();
18352 __struct.mode_switch = buf.get_u8();
18353 __struct.manual_override_switch = buf.get_u8();
18354 Ok(__struct)
18355 }
18356 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18357 let mut __tmp = BytesMut::new(bytes);
18358 #[allow(clippy::absurd_extreme_comparisons)]
18359 #[allow(unused_comparisons)]
18360 if __tmp.remaining() < Self::ENCODED_LEN {
18361 panic!(
18362 "buffer is too small (need {} bytes, but got {})",
18363 Self::ENCODED_LEN,
18364 __tmp.remaining(),
18365 )
18366 }
18367 __tmp.put_u32_le(self.time_boot_ms);
18368 __tmp.put_f32_le(self.roll);
18369 __tmp.put_f32_le(self.pitch);
18370 __tmp.put_f32_le(self.yaw);
18371 __tmp.put_f32_le(self.thrust);
18372 __tmp.put_u8(self.mode_switch);
18373 __tmp.put_u8(self.manual_override_switch);
18374 if matches!(version, MavlinkVersion::V2) {
18375 let len = __tmp.len();
18376 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18377 } else {
18378 __tmp.len()
18379 }
18380 }
18381}
18382#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
18383#[doc = ""]
18384#[doc = "ID: 249"]
18385#[derive(Debug, Clone, PartialEq)]
18386#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18387#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18388pub struct MEMORY_VECT_DATA {
18389 #[doc = "Starting address of the debug variables"]
18390 pub address: u16,
18391 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
18392 pub ver: u8,
18393 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
18394 pub mavtype: u8,
18395 #[doc = "Memory contents at specified address"]
18396 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18397 pub value: [i8; 32],
18398}
18399impl MEMORY_VECT_DATA {
18400 pub const ENCODED_LEN: usize = 36usize;
18401 pub const DEFAULT: Self = Self {
18402 address: 0_u16,
18403 ver: 0_u8,
18404 mavtype: 0_u8,
18405 value: [0_i8; 32usize],
18406 };
18407 #[cfg(feature = "arbitrary")]
18408 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18409 use arbitrary::{Arbitrary, Unstructured};
18410 let mut buf = [0u8; 1024];
18411 rng.fill_bytes(&mut buf);
18412 let mut unstructured = Unstructured::new(&buf);
18413 Self::arbitrary(&mut unstructured).unwrap_or_default()
18414 }
18415}
18416impl Default for MEMORY_VECT_DATA {
18417 fn default() -> Self {
18418 Self::DEFAULT.clone()
18419 }
18420}
18421impl MessageData for MEMORY_VECT_DATA {
18422 type Message = MavMessage;
18423 const ID: u32 = 249u32;
18424 const NAME: &'static str = "MEMORY_VECT";
18425 const EXTRA_CRC: u8 = 204u8;
18426 const ENCODED_LEN: usize = 36usize;
18427 fn deser(
18428 _version: MavlinkVersion,
18429 __input: &[u8],
18430 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18431 let avail_len = __input.len();
18432 let mut payload_buf = [0; Self::ENCODED_LEN];
18433 let mut buf = if avail_len < Self::ENCODED_LEN {
18434 payload_buf[0..avail_len].copy_from_slice(__input);
18435 Bytes::new(&payload_buf)
18436 } else {
18437 Bytes::new(__input)
18438 };
18439 let mut __struct = Self::default();
18440 __struct.address = buf.get_u16_le();
18441 __struct.ver = buf.get_u8();
18442 __struct.mavtype = buf.get_u8();
18443 for v in &mut __struct.value {
18444 let val = buf.get_i8();
18445 *v = val;
18446 }
18447 Ok(__struct)
18448 }
18449 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18450 let mut __tmp = BytesMut::new(bytes);
18451 #[allow(clippy::absurd_extreme_comparisons)]
18452 #[allow(unused_comparisons)]
18453 if __tmp.remaining() < Self::ENCODED_LEN {
18454 panic!(
18455 "buffer is too small (need {} bytes, but got {})",
18456 Self::ENCODED_LEN,
18457 __tmp.remaining(),
18458 )
18459 }
18460 __tmp.put_u16_le(self.address);
18461 __tmp.put_u8(self.ver);
18462 __tmp.put_u8(self.mavtype);
18463 for val in &self.value {
18464 __tmp.put_i8(*val);
18465 }
18466 if matches!(version, MavlinkVersion::V2) {
18467 let len = __tmp.len();
18468 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18469 } else {
18470 __tmp.len()
18471 }
18472 }
18473}
18474#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
18475#[doc = ""]
18476#[doc = "ID: 244"]
18477#[derive(Debug, Clone, PartialEq)]
18478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18479#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18480pub struct MESSAGE_INTERVAL_DATA {
18481 #[doc = "0 indicates the interval at which it is sent."]
18482 pub interval_us: i32,
18483 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
18484 pub message_id: u16,
18485}
18486impl MESSAGE_INTERVAL_DATA {
18487 pub const ENCODED_LEN: usize = 6usize;
18488 pub const DEFAULT: Self = Self {
18489 interval_us: 0_i32,
18490 message_id: 0_u16,
18491 };
18492 #[cfg(feature = "arbitrary")]
18493 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18494 use arbitrary::{Arbitrary, Unstructured};
18495 let mut buf = [0u8; 1024];
18496 rng.fill_bytes(&mut buf);
18497 let mut unstructured = Unstructured::new(&buf);
18498 Self::arbitrary(&mut unstructured).unwrap_or_default()
18499 }
18500}
18501impl Default for MESSAGE_INTERVAL_DATA {
18502 fn default() -> Self {
18503 Self::DEFAULT.clone()
18504 }
18505}
18506impl MessageData for MESSAGE_INTERVAL_DATA {
18507 type Message = MavMessage;
18508 const ID: u32 = 244u32;
18509 const NAME: &'static str = "MESSAGE_INTERVAL";
18510 const EXTRA_CRC: u8 = 95u8;
18511 const ENCODED_LEN: usize = 6usize;
18512 fn deser(
18513 _version: MavlinkVersion,
18514 __input: &[u8],
18515 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18516 let avail_len = __input.len();
18517 let mut payload_buf = [0; Self::ENCODED_LEN];
18518 let mut buf = if avail_len < Self::ENCODED_LEN {
18519 payload_buf[0..avail_len].copy_from_slice(__input);
18520 Bytes::new(&payload_buf)
18521 } else {
18522 Bytes::new(__input)
18523 };
18524 let mut __struct = Self::default();
18525 __struct.interval_us = buf.get_i32_le();
18526 __struct.message_id = buf.get_u16_le();
18527 Ok(__struct)
18528 }
18529 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18530 let mut __tmp = BytesMut::new(bytes);
18531 #[allow(clippy::absurd_extreme_comparisons)]
18532 #[allow(unused_comparisons)]
18533 if __tmp.remaining() < Self::ENCODED_LEN {
18534 panic!(
18535 "buffer is too small (need {} bytes, but got {})",
18536 Self::ENCODED_LEN,
18537 __tmp.remaining(),
18538 )
18539 }
18540 __tmp.put_i32_le(self.interval_us);
18541 __tmp.put_u16_le(self.message_id);
18542 if matches!(version, MavlinkVersion::V2) {
18543 let len = __tmp.len();
18544 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18545 } else {
18546 __tmp.len()
18547 }
18548 }
18549}
18550#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
18551#[doc = ""]
18552#[doc = "ID: 47"]
18553#[derive(Debug, Clone, PartialEq)]
18554#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18555#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18556pub struct MISSION_ACK_DATA {
18557 #[doc = "System ID"]
18558 pub target_system: u8,
18559 #[doc = "Component ID"]
18560 pub target_component: u8,
18561 #[doc = "Mission result."]
18562 pub mavtype: MavMissionResult,
18563 #[doc = "Mission type."]
18564 #[cfg_attr(feature = "serde", serde(default))]
18565 pub mission_type: MavMissionType,
18566 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
18567 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18568 pub opaque_id: u32,
18569}
18570impl MISSION_ACK_DATA {
18571 pub const ENCODED_LEN: usize = 8usize;
18572 pub const DEFAULT: Self = Self {
18573 target_system: 0_u8,
18574 target_component: 0_u8,
18575 mavtype: MavMissionResult::DEFAULT,
18576 mission_type: MavMissionType::DEFAULT,
18577 opaque_id: 0_u32,
18578 };
18579 #[cfg(feature = "arbitrary")]
18580 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18581 use arbitrary::{Arbitrary, Unstructured};
18582 let mut buf = [0u8; 1024];
18583 rng.fill_bytes(&mut buf);
18584 let mut unstructured = Unstructured::new(&buf);
18585 Self::arbitrary(&mut unstructured).unwrap_or_default()
18586 }
18587}
18588impl Default for MISSION_ACK_DATA {
18589 fn default() -> Self {
18590 Self::DEFAULT.clone()
18591 }
18592}
18593impl MessageData for MISSION_ACK_DATA {
18594 type Message = MavMessage;
18595 const ID: u32 = 47u32;
18596 const NAME: &'static str = "MISSION_ACK";
18597 const EXTRA_CRC: u8 = 153u8;
18598 const ENCODED_LEN: usize = 8usize;
18599 fn deser(
18600 _version: MavlinkVersion,
18601 __input: &[u8],
18602 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18603 let avail_len = __input.len();
18604 let mut payload_buf = [0; Self::ENCODED_LEN];
18605 let mut buf = if avail_len < Self::ENCODED_LEN {
18606 payload_buf[0..avail_len].copy_from_slice(__input);
18607 Bytes::new(&payload_buf)
18608 } else {
18609 Bytes::new(__input)
18610 };
18611 let mut __struct = Self::default();
18612 __struct.target_system = buf.get_u8();
18613 __struct.target_component = buf.get_u8();
18614 let tmp = buf.get_u8();
18615 __struct.mavtype =
18616 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18617 enum_type: "MavMissionResult",
18618 value: tmp as u32,
18619 })?;
18620 let tmp = buf.get_u8();
18621 __struct.mission_type =
18622 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18623 enum_type: "MavMissionType",
18624 value: tmp as u32,
18625 })?;
18626 __struct.opaque_id = buf.get_u32_le();
18627 Ok(__struct)
18628 }
18629 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18630 let mut __tmp = BytesMut::new(bytes);
18631 #[allow(clippy::absurd_extreme_comparisons)]
18632 #[allow(unused_comparisons)]
18633 if __tmp.remaining() < Self::ENCODED_LEN {
18634 panic!(
18635 "buffer is too small (need {} bytes, but got {})",
18636 Self::ENCODED_LEN,
18637 __tmp.remaining(),
18638 )
18639 }
18640 __tmp.put_u8(self.target_system);
18641 __tmp.put_u8(self.target_component);
18642 __tmp.put_u8(self.mavtype as u8);
18643 if matches!(version, MavlinkVersion::V2) {
18644 __tmp.put_u8(self.mission_type as u8);
18645 __tmp.put_u32_le(self.opaque_id);
18646 let len = __tmp.len();
18647 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18648 } else {
18649 __tmp.len()
18650 }
18651 }
18652}
18653#[doc = "Delete all mission items at once."]
18654#[doc = ""]
18655#[doc = "ID: 45"]
18656#[derive(Debug, Clone, PartialEq)]
18657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18658#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18659pub struct MISSION_CLEAR_ALL_DATA {
18660 #[doc = "System ID"]
18661 pub target_system: u8,
18662 #[doc = "Component ID"]
18663 pub target_component: u8,
18664 #[doc = "Mission type."]
18665 #[cfg_attr(feature = "serde", serde(default))]
18666 pub mission_type: MavMissionType,
18667}
18668impl MISSION_CLEAR_ALL_DATA {
18669 pub const ENCODED_LEN: usize = 3usize;
18670 pub const DEFAULT: Self = Self {
18671 target_system: 0_u8,
18672 target_component: 0_u8,
18673 mission_type: MavMissionType::DEFAULT,
18674 };
18675 #[cfg(feature = "arbitrary")]
18676 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18677 use arbitrary::{Arbitrary, Unstructured};
18678 let mut buf = [0u8; 1024];
18679 rng.fill_bytes(&mut buf);
18680 let mut unstructured = Unstructured::new(&buf);
18681 Self::arbitrary(&mut unstructured).unwrap_or_default()
18682 }
18683}
18684impl Default for MISSION_CLEAR_ALL_DATA {
18685 fn default() -> Self {
18686 Self::DEFAULT.clone()
18687 }
18688}
18689impl MessageData for MISSION_CLEAR_ALL_DATA {
18690 type Message = MavMessage;
18691 const ID: u32 = 45u32;
18692 const NAME: &'static str = "MISSION_CLEAR_ALL";
18693 const EXTRA_CRC: u8 = 232u8;
18694 const ENCODED_LEN: usize = 3usize;
18695 fn deser(
18696 _version: MavlinkVersion,
18697 __input: &[u8],
18698 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18699 let avail_len = __input.len();
18700 let mut payload_buf = [0; Self::ENCODED_LEN];
18701 let mut buf = if avail_len < Self::ENCODED_LEN {
18702 payload_buf[0..avail_len].copy_from_slice(__input);
18703 Bytes::new(&payload_buf)
18704 } else {
18705 Bytes::new(__input)
18706 };
18707 let mut __struct = Self::default();
18708 __struct.target_system = buf.get_u8();
18709 __struct.target_component = buf.get_u8();
18710 let tmp = buf.get_u8();
18711 __struct.mission_type =
18712 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18713 enum_type: "MavMissionType",
18714 value: tmp as u32,
18715 })?;
18716 Ok(__struct)
18717 }
18718 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18719 let mut __tmp = BytesMut::new(bytes);
18720 #[allow(clippy::absurd_extreme_comparisons)]
18721 #[allow(unused_comparisons)]
18722 if __tmp.remaining() < Self::ENCODED_LEN {
18723 panic!(
18724 "buffer is too small (need {} bytes, but got {})",
18725 Self::ENCODED_LEN,
18726 __tmp.remaining(),
18727 )
18728 }
18729 __tmp.put_u8(self.target_system);
18730 __tmp.put_u8(self.target_component);
18731 if matches!(version, MavlinkVersion::V2) {
18732 __tmp.put_u8(self.mission_type as u8);
18733 let len = __tmp.len();
18734 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18735 } else {
18736 __tmp.len()
18737 }
18738 }
18739}
18740#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
18741#[doc = ""]
18742#[doc = "ID: 44"]
18743#[derive(Debug, Clone, PartialEq)]
18744#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18745#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18746pub struct MISSION_COUNT_DATA {
18747 #[doc = "Number of mission items in the sequence"]
18748 pub count: u16,
18749 #[doc = "System ID"]
18750 pub target_system: u8,
18751 #[doc = "Component ID"]
18752 pub target_component: u8,
18753 #[doc = "Mission type."]
18754 #[cfg_attr(feature = "serde", serde(default))]
18755 pub mission_type: MavMissionType,
18756 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
18757 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18758 pub opaque_id: u32,
18759}
18760impl MISSION_COUNT_DATA {
18761 pub const ENCODED_LEN: usize = 9usize;
18762 pub const DEFAULT: Self = Self {
18763 count: 0_u16,
18764 target_system: 0_u8,
18765 target_component: 0_u8,
18766 mission_type: MavMissionType::DEFAULT,
18767 opaque_id: 0_u32,
18768 };
18769 #[cfg(feature = "arbitrary")]
18770 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18771 use arbitrary::{Arbitrary, Unstructured};
18772 let mut buf = [0u8; 1024];
18773 rng.fill_bytes(&mut buf);
18774 let mut unstructured = Unstructured::new(&buf);
18775 Self::arbitrary(&mut unstructured).unwrap_or_default()
18776 }
18777}
18778impl Default for MISSION_COUNT_DATA {
18779 fn default() -> Self {
18780 Self::DEFAULT.clone()
18781 }
18782}
18783impl MessageData for MISSION_COUNT_DATA {
18784 type Message = MavMessage;
18785 const ID: u32 = 44u32;
18786 const NAME: &'static str = "MISSION_COUNT";
18787 const EXTRA_CRC: u8 = 221u8;
18788 const ENCODED_LEN: usize = 9usize;
18789 fn deser(
18790 _version: MavlinkVersion,
18791 __input: &[u8],
18792 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18793 let avail_len = __input.len();
18794 let mut payload_buf = [0; Self::ENCODED_LEN];
18795 let mut buf = if avail_len < Self::ENCODED_LEN {
18796 payload_buf[0..avail_len].copy_from_slice(__input);
18797 Bytes::new(&payload_buf)
18798 } else {
18799 Bytes::new(__input)
18800 };
18801 let mut __struct = Self::default();
18802 __struct.count = buf.get_u16_le();
18803 __struct.target_system = buf.get_u8();
18804 __struct.target_component = buf.get_u8();
18805 let tmp = buf.get_u8();
18806 __struct.mission_type =
18807 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18808 enum_type: "MavMissionType",
18809 value: tmp as u32,
18810 })?;
18811 __struct.opaque_id = buf.get_u32_le();
18812 Ok(__struct)
18813 }
18814 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18815 let mut __tmp = BytesMut::new(bytes);
18816 #[allow(clippy::absurd_extreme_comparisons)]
18817 #[allow(unused_comparisons)]
18818 if __tmp.remaining() < Self::ENCODED_LEN {
18819 panic!(
18820 "buffer is too small (need {} bytes, but got {})",
18821 Self::ENCODED_LEN,
18822 __tmp.remaining(),
18823 )
18824 }
18825 __tmp.put_u16_le(self.count);
18826 __tmp.put_u8(self.target_system);
18827 __tmp.put_u8(self.target_component);
18828 if matches!(version, MavlinkVersion::V2) {
18829 __tmp.put_u8(self.mission_type as u8);
18830 __tmp.put_u32_le(self.opaque_id);
18831 let len = __tmp.len();
18832 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18833 } else {
18834 __tmp.len()
18835 }
18836 }
18837}
18838#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
18839#[doc = ""]
18840#[doc = "ID: 42"]
18841#[derive(Debug, Clone, PartialEq)]
18842#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18843#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18844pub struct MISSION_CURRENT_DATA {
18845 #[doc = "Sequence"]
18846 pub seq: u16,
18847 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
18848 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18849 pub total: u16,
18850 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
18851 #[cfg_attr(feature = "serde", serde(default))]
18852 pub mission_state: MissionState,
18853 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
18854 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18855 pub mission_mode: u8,
18856 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
18857 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18858 pub mission_id: u32,
18859 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
18860 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18861 pub fence_id: u32,
18862 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
18863 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18864 pub rally_points_id: u32,
18865}
18866impl MISSION_CURRENT_DATA {
18867 pub const ENCODED_LEN: usize = 18usize;
18868 pub const DEFAULT: Self = Self {
18869 seq: 0_u16,
18870 total: 0_u16,
18871 mission_state: MissionState::DEFAULT,
18872 mission_mode: 0_u8,
18873 mission_id: 0_u32,
18874 fence_id: 0_u32,
18875 rally_points_id: 0_u32,
18876 };
18877 #[cfg(feature = "arbitrary")]
18878 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18879 use arbitrary::{Arbitrary, Unstructured};
18880 let mut buf = [0u8; 1024];
18881 rng.fill_bytes(&mut buf);
18882 let mut unstructured = Unstructured::new(&buf);
18883 Self::arbitrary(&mut unstructured).unwrap_or_default()
18884 }
18885}
18886impl Default for MISSION_CURRENT_DATA {
18887 fn default() -> Self {
18888 Self::DEFAULT.clone()
18889 }
18890}
18891impl MessageData for MISSION_CURRENT_DATA {
18892 type Message = MavMessage;
18893 const ID: u32 = 42u32;
18894 const NAME: &'static str = "MISSION_CURRENT";
18895 const EXTRA_CRC: u8 = 28u8;
18896 const ENCODED_LEN: usize = 18usize;
18897 fn deser(
18898 _version: MavlinkVersion,
18899 __input: &[u8],
18900 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18901 let avail_len = __input.len();
18902 let mut payload_buf = [0; Self::ENCODED_LEN];
18903 let mut buf = if avail_len < Self::ENCODED_LEN {
18904 payload_buf[0..avail_len].copy_from_slice(__input);
18905 Bytes::new(&payload_buf)
18906 } else {
18907 Bytes::new(__input)
18908 };
18909 let mut __struct = Self::default();
18910 __struct.seq = buf.get_u16_le();
18911 __struct.total = buf.get_u16_le();
18912 let tmp = buf.get_u8();
18913 __struct.mission_state =
18914 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18915 enum_type: "MissionState",
18916 value: tmp as u32,
18917 })?;
18918 __struct.mission_mode = buf.get_u8();
18919 __struct.mission_id = buf.get_u32_le();
18920 __struct.fence_id = buf.get_u32_le();
18921 __struct.rally_points_id = buf.get_u32_le();
18922 Ok(__struct)
18923 }
18924 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18925 let mut __tmp = BytesMut::new(bytes);
18926 #[allow(clippy::absurd_extreme_comparisons)]
18927 #[allow(unused_comparisons)]
18928 if __tmp.remaining() < Self::ENCODED_LEN {
18929 panic!(
18930 "buffer is too small (need {} bytes, but got {})",
18931 Self::ENCODED_LEN,
18932 __tmp.remaining(),
18933 )
18934 }
18935 __tmp.put_u16_le(self.seq);
18936 if matches!(version, MavlinkVersion::V2) {
18937 __tmp.put_u16_le(self.total);
18938 __tmp.put_u8(self.mission_state as u8);
18939 __tmp.put_u8(self.mission_mode);
18940 __tmp.put_u32_le(self.mission_id);
18941 __tmp.put_u32_le(self.fence_id);
18942 __tmp.put_u32_le(self.rally_points_id);
18943 let len = __tmp.len();
18944 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18945 } else {
18946 __tmp.len()
18947 }
18948 }
18949}
18950#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
18951#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
18952#[doc = ""]
18953#[doc = "ID: 39"]
18954#[derive(Debug, Clone, PartialEq)]
18955#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18956#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18957pub struct MISSION_ITEM_DATA {
18958 #[doc = "PARAM1, see MAV_CMD enum"]
18959 pub param1: f32,
18960 #[doc = "PARAM2, see MAV_CMD enum"]
18961 pub param2: f32,
18962 #[doc = "PARAM3, see MAV_CMD enum"]
18963 pub param3: f32,
18964 #[doc = "PARAM4, see MAV_CMD enum"]
18965 pub param4: f32,
18966 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
18967 pub x: f32,
18968 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
18969 pub y: f32,
18970 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
18971 pub z: f32,
18972 #[doc = "Sequence"]
18973 pub seq: u16,
18974 #[doc = "The scheduled action for the waypoint."]
18975 pub command: MavCmd,
18976 #[doc = "System ID"]
18977 pub target_system: u8,
18978 #[doc = "Component ID"]
18979 pub target_component: u8,
18980 #[doc = "The coordinate system of the waypoint."]
18981 pub frame: MavFrame,
18982 #[doc = "false:0, true:1"]
18983 pub current: u8,
18984 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
18985 pub autocontinue: u8,
18986 #[doc = "Mission type."]
18987 #[cfg_attr(feature = "serde", serde(default))]
18988 pub mission_type: MavMissionType,
18989}
18990impl MISSION_ITEM_DATA {
18991 pub const ENCODED_LEN: usize = 38usize;
18992 pub const DEFAULT: Self = Self {
18993 param1: 0.0_f32,
18994 param2: 0.0_f32,
18995 param3: 0.0_f32,
18996 param4: 0.0_f32,
18997 x: 0.0_f32,
18998 y: 0.0_f32,
18999 z: 0.0_f32,
19000 seq: 0_u16,
19001 command: MavCmd::DEFAULT,
19002 target_system: 0_u8,
19003 target_component: 0_u8,
19004 frame: MavFrame::DEFAULT,
19005 current: 0_u8,
19006 autocontinue: 0_u8,
19007 mission_type: MavMissionType::DEFAULT,
19008 };
19009 #[cfg(feature = "arbitrary")]
19010 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19011 use arbitrary::{Arbitrary, Unstructured};
19012 let mut buf = [0u8; 1024];
19013 rng.fill_bytes(&mut buf);
19014 let mut unstructured = Unstructured::new(&buf);
19015 Self::arbitrary(&mut unstructured).unwrap_or_default()
19016 }
19017}
19018impl Default for MISSION_ITEM_DATA {
19019 fn default() -> Self {
19020 Self::DEFAULT.clone()
19021 }
19022}
19023impl MessageData for MISSION_ITEM_DATA {
19024 type Message = MavMessage;
19025 const ID: u32 = 39u32;
19026 const NAME: &'static str = "MISSION_ITEM";
19027 const EXTRA_CRC: u8 = 254u8;
19028 const ENCODED_LEN: usize = 38usize;
19029 fn deser(
19030 _version: MavlinkVersion,
19031 __input: &[u8],
19032 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19033 let avail_len = __input.len();
19034 let mut payload_buf = [0; Self::ENCODED_LEN];
19035 let mut buf = if avail_len < Self::ENCODED_LEN {
19036 payload_buf[0..avail_len].copy_from_slice(__input);
19037 Bytes::new(&payload_buf)
19038 } else {
19039 Bytes::new(__input)
19040 };
19041 let mut __struct = Self::default();
19042 __struct.param1 = buf.get_f32_le();
19043 __struct.param2 = buf.get_f32_le();
19044 __struct.param3 = buf.get_f32_le();
19045 __struct.param4 = buf.get_f32_le();
19046 __struct.x = buf.get_f32_le();
19047 __struct.y = buf.get_f32_le();
19048 __struct.z = buf.get_f32_le();
19049 __struct.seq = buf.get_u16_le();
19050 let tmp = buf.get_u16_le();
19051 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19052 ::mavlink_core::error::ParserError::InvalidEnum {
19053 enum_type: "MavCmd",
19054 value: tmp as u32,
19055 },
19056 )?;
19057 __struct.target_system = buf.get_u8();
19058 __struct.target_component = buf.get_u8();
19059 let tmp = buf.get_u8();
19060 __struct.frame =
19061 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19062 enum_type: "MavFrame",
19063 value: tmp as u32,
19064 })?;
19065 __struct.current = buf.get_u8();
19066 __struct.autocontinue = buf.get_u8();
19067 let tmp = buf.get_u8();
19068 __struct.mission_type =
19069 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19070 enum_type: "MavMissionType",
19071 value: tmp as u32,
19072 })?;
19073 Ok(__struct)
19074 }
19075 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19076 let mut __tmp = BytesMut::new(bytes);
19077 #[allow(clippy::absurd_extreme_comparisons)]
19078 #[allow(unused_comparisons)]
19079 if __tmp.remaining() < Self::ENCODED_LEN {
19080 panic!(
19081 "buffer is too small (need {} bytes, but got {})",
19082 Self::ENCODED_LEN,
19083 __tmp.remaining(),
19084 )
19085 }
19086 __tmp.put_f32_le(self.param1);
19087 __tmp.put_f32_le(self.param2);
19088 __tmp.put_f32_le(self.param3);
19089 __tmp.put_f32_le(self.param4);
19090 __tmp.put_f32_le(self.x);
19091 __tmp.put_f32_le(self.y);
19092 __tmp.put_f32_le(self.z);
19093 __tmp.put_u16_le(self.seq);
19094 __tmp.put_u16_le(self.command as u16);
19095 __tmp.put_u8(self.target_system);
19096 __tmp.put_u8(self.target_component);
19097 __tmp.put_u8(self.frame as u8);
19098 __tmp.put_u8(self.current);
19099 __tmp.put_u8(self.autocontinue);
19100 if matches!(version, MavlinkVersion::V2) {
19101 __tmp.put_u8(self.mission_type as u8);
19102 let len = __tmp.len();
19103 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19104 } else {
19105 __tmp.len()
19106 }
19107 }
19108}
19109#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19110#[doc = ""]
19111#[doc = "ID: 73"]
19112#[derive(Debug, Clone, PartialEq)]
19113#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19114#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19115pub struct MISSION_ITEM_INT_DATA {
19116 #[doc = "PARAM1, see MAV_CMD enum"]
19117 pub param1: f32,
19118 #[doc = "PARAM2, see MAV_CMD enum"]
19119 pub param2: f32,
19120 #[doc = "PARAM3, see MAV_CMD enum"]
19121 pub param3: f32,
19122 #[doc = "PARAM4, see MAV_CMD enum"]
19123 pub param4: f32,
19124 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
19125 pub x: i32,
19126 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
19127 pub y: i32,
19128 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
19129 pub z: f32,
19130 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
19131 pub seq: u16,
19132 #[doc = "The scheduled action for the waypoint."]
19133 pub command: MavCmd,
19134 #[doc = "System ID"]
19135 pub target_system: u8,
19136 #[doc = "Component ID"]
19137 pub target_component: u8,
19138 #[doc = "The coordinate system of the waypoint."]
19139 pub frame: MavFrame,
19140 #[doc = "false:0, true:1"]
19141 pub current: u8,
19142 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19143 pub autocontinue: u8,
19144 #[doc = "Mission type."]
19145 #[cfg_attr(feature = "serde", serde(default))]
19146 pub mission_type: MavMissionType,
19147}
19148impl MISSION_ITEM_INT_DATA {
19149 pub const ENCODED_LEN: usize = 38usize;
19150 pub const DEFAULT: Self = Self {
19151 param1: 0.0_f32,
19152 param2: 0.0_f32,
19153 param3: 0.0_f32,
19154 param4: 0.0_f32,
19155 x: 0_i32,
19156 y: 0_i32,
19157 z: 0.0_f32,
19158 seq: 0_u16,
19159 command: MavCmd::DEFAULT,
19160 target_system: 0_u8,
19161 target_component: 0_u8,
19162 frame: MavFrame::DEFAULT,
19163 current: 0_u8,
19164 autocontinue: 0_u8,
19165 mission_type: MavMissionType::DEFAULT,
19166 };
19167 #[cfg(feature = "arbitrary")]
19168 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19169 use arbitrary::{Arbitrary, Unstructured};
19170 let mut buf = [0u8; 1024];
19171 rng.fill_bytes(&mut buf);
19172 let mut unstructured = Unstructured::new(&buf);
19173 Self::arbitrary(&mut unstructured).unwrap_or_default()
19174 }
19175}
19176impl Default for MISSION_ITEM_INT_DATA {
19177 fn default() -> Self {
19178 Self::DEFAULT.clone()
19179 }
19180}
19181impl MessageData for MISSION_ITEM_INT_DATA {
19182 type Message = MavMessage;
19183 const ID: u32 = 73u32;
19184 const NAME: &'static str = "MISSION_ITEM_INT";
19185 const EXTRA_CRC: u8 = 38u8;
19186 const ENCODED_LEN: usize = 38usize;
19187 fn deser(
19188 _version: MavlinkVersion,
19189 __input: &[u8],
19190 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19191 let avail_len = __input.len();
19192 let mut payload_buf = [0; Self::ENCODED_LEN];
19193 let mut buf = if avail_len < Self::ENCODED_LEN {
19194 payload_buf[0..avail_len].copy_from_slice(__input);
19195 Bytes::new(&payload_buf)
19196 } else {
19197 Bytes::new(__input)
19198 };
19199 let mut __struct = Self::default();
19200 __struct.param1 = buf.get_f32_le();
19201 __struct.param2 = buf.get_f32_le();
19202 __struct.param3 = buf.get_f32_le();
19203 __struct.param4 = buf.get_f32_le();
19204 __struct.x = buf.get_i32_le();
19205 __struct.y = buf.get_i32_le();
19206 __struct.z = buf.get_f32_le();
19207 __struct.seq = buf.get_u16_le();
19208 let tmp = buf.get_u16_le();
19209 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19210 ::mavlink_core::error::ParserError::InvalidEnum {
19211 enum_type: "MavCmd",
19212 value: tmp as u32,
19213 },
19214 )?;
19215 __struct.target_system = buf.get_u8();
19216 __struct.target_component = buf.get_u8();
19217 let tmp = buf.get_u8();
19218 __struct.frame =
19219 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19220 enum_type: "MavFrame",
19221 value: tmp as u32,
19222 })?;
19223 __struct.current = buf.get_u8();
19224 __struct.autocontinue = buf.get_u8();
19225 let tmp = buf.get_u8();
19226 __struct.mission_type =
19227 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19228 enum_type: "MavMissionType",
19229 value: tmp as u32,
19230 })?;
19231 Ok(__struct)
19232 }
19233 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19234 let mut __tmp = BytesMut::new(bytes);
19235 #[allow(clippy::absurd_extreme_comparisons)]
19236 #[allow(unused_comparisons)]
19237 if __tmp.remaining() < Self::ENCODED_LEN {
19238 panic!(
19239 "buffer is too small (need {} bytes, but got {})",
19240 Self::ENCODED_LEN,
19241 __tmp.remaining(),
19242 )
19243 }
19244 __tmp.put_f32_le(self.param1);
19245 __tmp.put_f32_le(self.param2);
19246 __tmp.put_f32_le(self.param3);
19247 __tmp.put_f32_le(self.param4);
19248 __tmp.put_i32_le(self.x);
19249 __tmp.put_i32_le(self.y);
19250 __tmp.put_f32_le(self.z);
19251 __tmp.put_u16_le(self.seq);
19252 __tmp.put_u16_le(self.command as u16);
19253 __tmp.put_u8(self.target_system);
19254 __tmp.put_u8(self.target_component);
19255 __tmp.put_u8(self.frame as u8);
19256 __tmp.put_u8(self.current);
19257 __tmp.put_u8(self.autocontinue);
19258 if matches!(version, MavlinkVersion::V2) {
19259 __tmp.put_u8(self.mission_type as u8);
19260 let len = __tmp.len();
19261 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19262 } else {
19263 __tmp.len()
19264 }
19265 }
19266}
19267#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
19268#[doc = ""]
19269#[doc = "ID: 46"]
19270#[derive(Debug, Clone, PartialEq)]
19271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19273pub struct MISSION_ITEM_REACHED_DATA {
19274 #[doc = "Sequence"]
19275 pub seq: u16,
19276}
19277impl MISSION_ITEM_REACHED_DATA {
19278 pub const ENCODED_LEN: usize = 2usize;
19279 pub const DEFAULT: Self = Self { seq: 0_u16 };
19280 #[cfg(feature = "arbitrary")]
19281 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19282 use arbitrary::{Arbitrary, Unstructured};
19283 let mut buf = [0u8; 1024];
19284 rng.fill_bytes(&mut buf);
19285 let mut unstructured = Unstructured::new(&buf);
19286 Self::arbitrary(&mut unstructured).unwrap_or_default()
19287 }
19288}
19289impl Default for MISSION_ITEM_REACHED_DATA {
19290 fn default() -> Self {
19291 Self::DEFAULT.clone()
19292 }
19293}
19294impl MessageData for MISSION_ITEM_REACHED_DATA {
19295 type Message = MavMessage;
19296 const ID: u32 = 46u32;
19297 const NAME: &'static str = "MISSION_ITEM_REACHED";
19298 const EXTRA_CRC: u8 = 11u8;
19299 const ENCODED_LEN: usize = 2usize;
19300 fn deser(
19301 _version: MavlinkVersion,
19302 __input: &[u8],
19303 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19304 let avail_len = __input.len();
19305 let mut payload_buf = [0; Self::ENCODED_LEN];
19306 let mut buf = if avail_len < Self::ENCODED_LEN {
19307 payload_buf[0..avail_len].copy_from_slice(__input);
19308 Bytes::new(&payload_buf)
19309 } else {
19310 Bytes::new(__input)
19311 };
19312 let mut __struct = Self::default();
19313 __struct.seq = buf.get_u16_le();
19314 Ok(__struct)
19315 }
19316 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19317 let mut __tmp = BytesMut::new(bytes);
19318 #[allow(clippy::absurd_extreme_comparisons)]
19319 #[allow(unused_comparisons)]
19320 if __tmp.remaining() < Self::ENCODED_LEN {
19321 panic!(
19322 "buffer is too small (need {} bytes, but got {})",
19323 Self::ENCODED_LEN,
19324 __tmp.remaining(),
19325 )
19326 }
19327 __tmp.put_u16_le(self.seq);
19328 if matches!(version, MavlinkVersion::V2) {
19329 let len = __tmp.len();
19330 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19331 } else {
19332 __tmp.len()
19333 }
19334 }
19335}
19336#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
19337#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
19338#[doc = ""]
19339#[doc = "ID: 40"]
19340#[derive(Debug, Clone, PartialEq)]
19341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19343pub struct MISSION_REQUEST_DATA {
19344 #[doc = "Sequence"]
19345 pub seq: u16,
19346 #[doc = "System ID"]
19347 pub target_system: u8,
19348 #[doc = "Component ID"]
19349 pub target_component: u8,
19350 #[doc = "Mission type."]
19351 #[cfg_attr(feature = "serde", serde(default))]
19352 pub mission_type: MavMissionType,
19353}
19354impl MISSION_REQUEST_DATA {
19355 pub const ENCODED_LEN: usize = 5usize;
19356 pub const DEFAULT: Self = Self {
19357 seq: 0_u16,
19358 target_system: 0_u8,
19359 target_component: 0_u8,
19360 mission_type: MavMissionType::DEFAULT,
19361 };
19362 #[cfg(feature = "arbitrary")]
19363 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19364 use arbitrary::{Arbitrary, Unstructured};
19365 let mut buf = [0u8; 1024];
19366 rng.fill_bytes(&mut buf);
19367 let mut unstructured = Unstructured::new(&buf);
19368 Self::arbitrary(&mut unstructured).unwrap_or_default()
19369 }
19370}
19371impl Default for MISSION_REQUEST_DATA {
19372 fn default() -> Self {
19373 Self::DEFAULT.clone()
19374 }
19375}
19376impl MessageData for MISSION_REQUEST_DATA {
19377 type Message = MavMessage;
19378 const ID: u32 = 40u32;
19379 const NAME: &'static str = "MISSION_REQUEST";
19380 const EXTRA_CRC: u8 = 230u8;
19381 const ENCODED_LEN: usize = 5usize;
19382 fn deser(
19383 _version: MavlinkVersion,
19384 __input: &[u8],
19385 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19386 let avail_len = __input.len();
19387 let mut payload_buf = [0; Self::ENCODED_LEN];
19388 let mut buf = if avail_len < Self::ENCODED_LEN {
19389 payload_buf[0..avail_len].copy_from_slice(__input);
19390 Bytes::new(&payload_buf)
19391 } else {
19392 Bytes::new(__input)
19393 };
19394 let mut __struct = Self::default();
19395 __struct.seq = buf.get_u16_le();
19396 __struct.target_system = buf.get_u8();
19397 __struct.target_component = buf.get_u8();
19398 let tmp = buf.get_u8();
19399 __struct.mission_type =
19400 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19401 enum_type: "MavMissionType",
19402 value: tmp as u32,
19403 })?;
19404 Ok(__struct)
19405 }
19406 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19407 let mut __tmp = BytesMut::new(bytes);
19408 #[allow(clippy::absurd_extreme_comparisons)]
19409 #[allow(unused_comparisons)]
19410 if __tmp.remaining() < Self::ENCODED_LEN {
19411 panic!(
19412 "buffer is too small (need {} bytes, but got {})",
19413 Self::ENCODED_LEN,
19414 __tmp.remaining(),
19415 )
19416 }
19417 __tmp.put_u16_le(self.seq);
19418 __tmp.put_u8(self.target_system);
19419 __tmp.put_u8(self.target_component);
19420 if matches!(version, MavlinkVersion::V2) {
19421 __tmp.put_u8(self.mission_type as u8);
19422 let len = __tmp.len();
19423 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19424 } else {
19425 __tmp.len()
19426 }
19427 }
19428}
19429#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
19430#[doc = ""]
19431#[doc = "ID: 51"]
19432#[derive(Debug, Clone, PartialEq)]
19433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19434#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19435pub struct MISSION_REQUEST_INT_DATA {
19436 #[doc = "Sequence"]
19437 pub seq: u16,
19438 #[doc = "System ID"]
19439 pub target_system: u8,
19440 #[doc = "Component ID"]
19441 pub target_component: u8,
19442 #[doc = "Mission type."]
19443 #[cfg_attr(feature = "serde", serde(default))]
19444 pub mission_type: MavMissionType,
19445}
19446impl MISSION_REQUEST_INT_DATA {
19447 pub const ENCODED_LEN: usize = 5usize;
19448 pub const DEFAULT: Self = Self {
19449 seq: 0_u16,
19450 target_system: 0_u8,
19451 target_component: 0_u8,
19452 mission_type: MavMissionType::DEFAULT,
19453 };
19454 #[cfg(feature = "arbitrary")]
19455 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19456 use arbitrary::{Arbitrary, Unstructured};
19457 let mut buf = [0u8; 1024];
19458 rng.fill_bytes(&mut buf);
19459 let mut unstructured = Unstructured::new(&buf);
19460 Self::arbitrary(&mut unstructured).unwrap_or_default()
19461 }
19462}
19463impl Default for MISSION_REQUEST_INT_DATA {
19464 fn default() -> Self {
19465 Self::DEFAULT.clone()
19466 }
19467}
19468impl MessageData for MISSION_REQUEST_INT_DATA {
19469 type Message = MavMessage;
19470 const ID: u32 = 51u32;
19471 const NAME: &'static str = "MISSION_REQUEST_INT";
19472 const EXTRA_CRC: u8 = 196u8;
19473 const ENCODED_LEN: usize = 5usize;
19474 fn deser(
19475 _version: MavlinkVersion,
19476 __input: &[u8],
19477 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19478 let avail_len = __input.len();
19479 let mut payload_buf = [0; Self::ENCODED_LEN];
19480 let mut buf = if avail_len < Self::ENCODED_LEN {
19481 payload_buf[0..avail_len].copy_from_slice(__input);
19482 Bytes::new(&payload_buf)
19483 } else {
19484 Bytes::new(__input)
19485 };
19486 let mut __struct = Self::default();
19487 __struct.seq = buf.get_u16_le();
19488 __struct.target_system = buf.get_u8();
19489 __struct.target_component = buf.get_u8();
19490 let tmp = buf.get_u8();
19491 __struct.mission_type =
19492 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19493 enum_type: "MavMissionType",
19494 value: tmp as u32,
19495 })?;
19496 Ok(__struct)
19497 }
19498 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19499 let mut __tmp = BytesMut::new(bytes);
19500 #[allow(clippy::absurd_extreme_comparisons)]
19501 #[allow(unused_comparisons)]
19502 if __tmp.remaining() < Self::ENCODED_LEN {
19503 panic!(
19504 "buffer is too small (need {} bytes, but got {})",
19505 Self::ENCODED_LEN,
19506 __tmp.remaining(),
19507 )
19508 }
19509 __tmp.put_u16_le(self.seq);
19510 __tmp.put_u8(self.target_system);
19511 __tmp.put_u8(self.target_component);
19512 if matches!(version, MavlinkVersion::V2) {
19513 __tmp.put_u8(self.mission_type as u8);
19514 let len = __tmp.len();
19515 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19516 } else {
19517 __tmp.len()
19518 }
19519 }
19520}
19521#[doc = "Request the overall list of mission items from the system/component."]
19522#[doc = ""]
19523#[doc = "ID: 43"]
19524#[derive(Debug, Clone, PartialEq)]
19525#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19526#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19527pub struct MISSION_REQUEST_LIST_DATA {
19528 #[doc = "System ID"]
19529 pub target_system: u8,
19530 #[doc = "Component ID"]
19531 pub target_component: u8,
19532 #[doc = "Mission type."]
19533 #[cfg_attr(feature = "serde", serde(default))]
19534 pub mission_type: MavMissionType,
19535}
19536impl MISSION_REQUEST_LIST_DATA {
19537 pub const ENCODED_LEN: usize = 3usize;
19538 pub const DEFAULT: Self = Self {
19539 target_system: 0_u8,
19540 target_component: 0_u8,
19541 mission_type: MavMissionType::DEFAULT,
19542 };
19543 #[cfg(feature = "arbitrary")]
19544 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19545 use arbitrary::{Arbitrary, Unstructured};
19546 let mut buf = [0u8; 1024];
19547 rng.fill_bytes(&mut buf);
19548 let mut unstructured = Unstructured::new(&buf);
19549 Self::arbitrary(&mut unstructured).unwrap_or_default()
19550 }
19551}
19552impl Default for MISSION_REQUEST_LIST_DATA {
19553 fn default() -> Self {
19554 Self::DEFAULT.clone()
19555 }
19556}
19557impl MessageData for MISSION_REQUEST_LIST_DATA {
19558 type Message = MavMessage;
19559 const ID: u32 = 43u32;
19560 const NAME: &'static str = "MISSION_REQUEST_LIST";
19561 const EXTRA_CRC: u8 = 132u8;
19562 const ENCODED_LEN: usize = 3usize;
19563 fn deser(
19564 _version: MavlinkVersion,
19565 __input: &[u8],
19566 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19567 let avail_len = __input.len();
19568 let mut payload_buf = [0; Self::ENCODED_LEN];
19569 let mut buf = if avail_len < Self::ENCODED_LEN {
19570 payload_buf[0..avail_len].copy_from_slice(__input);
19571 Bytes::new(&payload_buf)
19572 } else {
19573 Bytes::new(__input)
19574 };
19575 let mut __struct = Self::default();
19576 __struct.target_system = buf.get_u8();
19577 __struct.target_component = buf.get_u8();
19578 let tmp = buf.get_u8();
19579 __struct.mission_type =
19580 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19581 enum_type: "MavMissionType",
19582 value: tmp as u32,
19583 })?;
19584 Ok(__struct)
19585 }
19586 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19587 let mut __tmp = BytesMut::new(bytes);
19588 #[allow(clippy::absurd_extreme_comparisons)]
19589 #[allow(unused_comparisons)]
19590 if __tmp.remaining() < Self::ENCODED_LEN {
19591 panic!(
19592 "buffer is too small (need {} bytes, but got {})",
19593 Self::ENCODED_LEN,
19594 __tmp.remaining(),
19595 )
19596 }
19597 __tmp.put_u8(self.target_system);
19598 __tmp.put_u8(self.target_component);
19599 if matches!(version, MavlinkVersion::V2) {
19600 __tmp.put_u8(self.mission_type as u8);
19601 let len = __tmp.len();
19602 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19603 } else {
19604 __tmp.len()
19605 }
19606 }
19607}
19608#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
19609#[doc = ""]
19610#[doc = "ID: 37"]
19611#[derive(Debug, Clone, PartialEq)]
19612#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19613#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19614pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
19615 #[doc = "Start index"]
19616 pub start_index: i16,
19617 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
19618 pub end_index: i16,
19619 #[doc = "System ID"]
19620 pub target_system: u8,
19621 #[doc = "Component ID"]
19622 pub target_component: u8,
19623 #[doc = "Mission type."]
19624 #[cfg_attr(feature = "serde", serde(default))]
19625 pub mission_type: MavMissionType,
19626}
19627impl MISSION_REQUEST_PARTIAL_LIST_DATA {
19628 pub const ENCODED_LEN: usize = 7usize;
19629 pub const DEFAULT: Self = Self {
19630 start_index: 0_i16,
19631 end_index: 0_i16,
19632 target_system: 0_u8,
19633 target_component: 0_u8,
19634 mission_type: MavMissionType::DEFAULT,
19635 };
19636 #[cfg(feature = "arbitrary")]
19637 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19638 use arbitrary::{Arbitrary, Unstructured};
19639 let mut buf = [0u8; 1024];
19640 rng.fill_bytes(&mut buf);
19641 let mut unstructured = Unstructured::new(&buf);
19642 Self::arbitrary(&mut unstructured).unwrap_or_default()
19643 }
19644}
19645impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
19646 fn default() -> Self {
19647 Self::DEFAULT.clone()
19648 }
19649}
19650impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
19651 type Message = MavMessage;
19652 const ID: u32 = 37u32;
19653 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
19654 const EXTRA_CRC: u8 = 212u8;
19655 const ENCODED_LEN: usize = 7usize;
19656 fn deser(
19657 _version: MavlinkVersion,
19658 __input: &[u8],
19659 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19660 let avail_len = __input.len();
19661 let mut payload_buf = [0; Self::ENCODED_LEN];
19662 let mut buf = if avail_len < Self::ENCODED_LEN {
19663 payload_buf[0..avail_len].copy_from_slice(__input);
19664 Bytes::new(&payload_buf)
19665 } else {
19666 Bytes::new(__input)
19667 };
19668 let mut __struct = Self::default();
19669 __struct.start_index = buf.get_i16_le();
19670 __struct.end_index = buf.get_i16_le();
19671 __struct.target_system = buf.get_u8();
19672 __struct.target_component = buf.get_u8();
19673 let tmp = buf.get_u8();
19674 __struct.mission_type =
19675 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19676 enum_type: "MavMissionType",
19677 value: tmp as u32,
19678 })?;
19679 Ok(__struct)
19680 }
19681 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19682 let mut __tmp = BytesMut::new(bytes);
19683 #[allow(clippy::absurd_extreme_comparisons)]
19684 #[allow(unused_comparisons)]
19685 if __tmp.remaining() < Self::ENCODED_LEN {
19686 panic!(
19687 "buffer is too small (need {} bytes, but got {})",
19688 Self::ENCODED_LEN,
19689 __tmp.remaining(),
19690 )
19691 }
19692 __tmp.put_i16_le(self.start_index);
19693 __tmp.put_i16_le(self.end_index);
19694 __tmp.put_u8(self.target_system);
19695 __tmp.put_u8(self.target_component);
19696 if matches!(version, MavlinkVersion::V2) {
19697 __tmp.put_u8(self.mission_type as u8);
19698 let len = __tmp.len();
19699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19700 } else {
19701 __tmp.len()
19702 }
19703 }
19704}
19705#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
19706#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
19707#[doc = ""]
19708#[doc = "ID: 41"]
19709#[derive(Debug, Clone, PartialEq)]
19710#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19711#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19712pub struct MISSION_SET_CURRENT_DATA {
19713 #[doc = "Sequence"]
19714 pub seq: u16,
19715 #[doc = "System ID"]
19716 pub target_system: u8,
19717 #[doc = "Component ID"]
19718 pub target_component: u8,
19719}
19720impl MISSION_SET_CURRENT_DATA {
19721 pub const ENCODED_LEN: usize = 4usize;
19722 pub const DEFAULT: Self = Self {
19723 seq: 0_u16,
19724 target_system: 0_u8,
19725 target_component: 0_u8,
19726 };
19727 #[cfg(feature = "arbitrary")]
19728 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19729 use arbitrary::{Arbitrary, Unstructured};
19730 let mut buf = [0u8; 1024];
19731 rng.fill_bytes(&mut buf);
19732 let mut unstructured = Unstructured::new(&buf);
19733 Self::arbitrary(&mut unstructured).unwrap_or_default()
19734 }
19735}
19736impl Default for MISSION_SET_CURRENT_DATA {
19737 fn default() -> Self {
19738 Self::DEFAULT.clone()
19739 }
19740}
19741impl MessageData for MISSION_SET_CURRENT_DATA {
19742 type Message = MavMessage;
19743 const ID: u32 = 41u32;
19744 const NAME: &'static str = "MISSION_SET_CURRENT";
19745 const EXTRA_CRC: u8 = 28u8;
19746 const ENCODED_LEN: usize = 4usize;
19747 fn deser(
19748 _version: MavlinkVersion,
19749 __input: &[u8],
19750 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19751 let avail_len = __input.len();
19752 let mut payload_buf = [0; Self::ENCODED_LEN];
19753 let mut buf = if avail_len < Self::ENCODED_LEN {
19754 payload_buf[0..avail_len].copy_from_slice(__input);
19755 Bytes::new(&payload_buf)
19756 } else {
19757 Bytes::new(__input)
19758 };
19759 let mut __struct = Self::default();
19760 __struct.seq = buf.get_u16_le();
19761 __struct.target_system = buf.get_u8();
19762 __struct.target_component = buf.get_u8();
19763 Ok(__struct)
19764 }
19765 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19766 let mut __tmp = BytesMut::new(bytes);
19767 #[allow(clippy::absurd_extreme_comparisons)]
19768 #[allow(unused_comparisons)]
19769 if __tmp.remaining() < Self::ENCODED_LEN {
19770 panic!(
19771 "buffer is too small (need {} bytes, but got {})",
19772 Self::ENCODED_LEN,
19773 __tmp.remaining(),
19774 )
19775 }
19776 __tmp.put_u16_le(self.seq);
19777 __tmp.put_u8(self.target_system);
19778 __tmp.put_u8(self.target_component);
19779 if matches!(version, MavlinkVersion::V2) {
19780 let len = __tmp.len();
19781 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19782 } else {
19783 __tmp.len()
19784 }
19785 }
19786}
19787#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
19788#[doc = ""]
19789#[doc = "ID: 38"]
19790#[derive(Debug, Clone, PartialEq)]
19791#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19792#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19793pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
19794 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
19795 pub start_index: i16,
19796 #[doc = "End index, equal or greater than start index."]
19797 pub end_index: i16,
19798 #[doc = "System ID"]
19799 pub target_system: u8,
19800 #[doc = "Component ID"]
19801 pub target_component: u8,
19802 #[doc = "Mission type."]
19803 #[cfg_attr(feature = "serde", serde(default))]
19804 pub mission_type: MavMissionType,
19805}
19806impl MISSION_WRITE_PARTIAL_LIST_DATA {
19807 pub const ENCODED_LEN: usize = 7usize;
19808 pub const DEFAULT: Self = Self {
19809 start_index: 0_i16,
19810 end_index: 0_i16,
19811 target_system: 0_u8,
19812 target_component: 0_u8,
19813 mission_type: MavMissionType::DEFAULT,
19814 };
19815 #[cfg(feature = "arbitrary")]
19816 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19817 use arbitrary::{Arbitrary, Unstructured};
19818 let mut buf = [0u8; 1024];
19819 rng.fill_bytes(&mut buf);
19820 let mut unstructured = Unstructured::new(&buf);
19821 Self::arbitrary(&mut unstructured).unwrap_or_default()
19822 }
19823}
19824impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
19825 fn default() -> Self {
19826 Self::DEFAULT.clone()
19827 }
19828}
19829impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
19830 type Message = MavMessage;
19831 const ID: u32 = 38u32;
19832 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
19833 const EXTRA_CRC: u8 = 9u8;
19834 const ENCODED_LEN: usize = 7usize;
19835 fn deser(
19836 _version: MavlinkVersion,
19837 __input: &[u8],
19838 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19839 let avail_len = __input.len();
19840 let mut payload_buf = [0; Self::ENCODED_LEN];
19841 let mut buf = if avail_len < Self::ENCODED_LEN {
19842 payload_buf[0..avail_len].copy_from_slice(__input);
19843 Bytes::new(&payload_buf)
19844 } else {
19845 Bytes::new(__input)
19846 };
19847 let mut __struct = Self::default();
19848 __struct.start_index = buf.get_i16_le();
19849 __struct.end_index = buf.get_i16_le();
19850 __struct.target_system = buf.get_u8();
19851 __struct.target_component = buf.get_u8();
19852 let tmp = buf.get_u8();
19853 __struct.mission_type =
19854 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19855 enum_type: "MavMissionType",
19856 value: tmp as u32,
19857 })?;
19858 Ok(__struct)
19859 }
19860 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19861 let mut __tmp = BytesMut::new(bytes);
19862 #[allow(clippy::absurd_extreme_comparisons)]
19863 #[allow(unused_comparisons)]
19864 if __tmp.remaining() < Self::ENCODED_LEN {
19865 panic!(
19866 "buffer is too small (need {} bytes, but got {})",
19867 Self::ENCODED_LEN,
19868 __tmp.remaining(),
19869 )
19870 }
19871 __tmp.put_i16_le(self.start_index);
19872 __tmp.put_i16_le(self.end_index);
19873 __tmp.put_u8(self.target_system);
19874 __tmp.put_u8(self.target_component);
19875 if matches!(version, MavlinkVersion::V2) {
19876 __tmp.put_u8(self.mission_type as u8);
19877 let len = __tmp.len();
19878 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19879 } else {
19880 __tmp.len()
19881 }
19882 }
19883}
19884#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
19885#[doc = "Orientation of a mount."]
19886#[doc = ""]
19887#[doc = "ID: 265"]
19888#[derive(Debug, Clone, PartialEq)]
19889#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19890#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19891pub struct MOUNT_ORIENTATION_DATA {
19892 #[doc = "Timestamp (time since system boot)."]
19893 pub time_boot_ms: u32,
19894 #[doc = "Roll in global frame (set to NaN for invalid)."]
19895 pub roll: f32,
19896 #[doc = "Pitch in global frame (set to NaN for invalid)."]
19897 pub pitch: f32,
19898 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
19899 pub yaw: f32,
19900 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
19901 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19902 pub yaw_absolute: f32,
19903}
19904impl MOUNT_ORIENTATION_DATA {
19905 pub const ENCODED_LEN: usize = 20usize;
19906 pub const DEFAULT: Self = Self {
19907 time_boot_ms: 0_u32,
19908 roll: 0.0_f32,
19909 pitch: 0.0_f32,
19910 yaw: 0.0_f32,
19911 yaw_absolute: 0.0_f32,
19912 };
19913 #[cfg(feature = "arbitrary")]
19914 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19915 use arbitrary::{Arbitrary, Unstructured};
19916 let mut buf = [0u8; 1024];
19917 rng.fill_bytes(&mut buf);
19918 let mut unstructured = Unstructured::new(&buf);
19919 Self::arbitrary(&mut unstructured).unwrap_or_default()
19920 }
19921}
19922impl Default for MOUNT_ORIENTATION_DATA {
19923 fn default() -> Self {
19924 Self::DEFAULT.clone()
19925 }
19926}
19927impl MessageData for MOUNT_ORIENTATION_DATA {
19928 type Message = MavMessage;
19929 const ID: u32 = 265u32;
19930 const NAME: &'static str = "MOUNT_ORIENTATION";
19931 const EXTRA_CRC: u8 = 26u8;
19932 const ENCODED_LEN: usize = 20usize;
19933 fn deser(
19934 _version: MavlinkVersion,
19935 __input: &[u8],
19936 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19937 let avail_len = __input.len();
19938 let mut payload_buf = [0; Self::ENCODED_LEN];
19939 let mut buf = if avail_len < Self::ENCODED_LEN {
19940 payload_buf[0..avail_len].copy_from_slice(__input);
19941 Bytes::new(&payload_buf)
19942 } else {
19943 Bytes::new(__input)
19944 };
19945 let mut __struct = Self::default();
19946 __struct.time_boot_ms = buf.get_u32_le();
19947 __struct.roll = buf.get_f32_le();
19948 __struct.pitch = buf.get_f32_le();
19949 __struct.yaw = buf.get_f32_le();
19950 __struct.yaw_absolute = buf.get_f32_le();
19951 Ok(__struct)
19952 }
19953 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19954 let mut __tmp = BytesMut::new(bytes);
19955 #[allow(clippy::absurd_extreme_comparisons)]
19956 #[allow(unused_comparisons)]
19957 if __tmp.remaining() < Self::ENCODED_LEN {
19958 panic!(
19959 "buffer is too small (need {} bytes, but got {})",
19960 Self::ENCODED_LEN,
19961 __tmp.remaining(),
19962 )
19963 }
19964 __tmp.put_u32_le(self.time_boot_ms);
19965 __tmp.put_f32_le(self.roll);
19966 __tmp.put_f32_le(self.pitch);
19967 __tmp.put_f32_le(self.yaw);
19968 if matches!(version, MavlinkVersion::V2) {
19969 __tmp.put_f32_le(self.yaw_absolute);
19970 let len = __tmp.len();
19971 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19972 } else {
19973 __tmp.len()
19974 }
19975 }
19976}
19977#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19978#[doc = ""]
19979#[doc = "ID: 251"]
19980#[derive(Debug, Clone, PartialEq)]
19981#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19982#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19983pub struct NAMED_VALUE_FLOAT_DATA {
19984 #[doc = "Timestamp (time since system boot)."]
19985 pub time_boot_ms: u32,
19986 #[doc = "Floating point value"]
19987 pub value: f32,
19988 #[doc = "Name of the debug variable"]
19989 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19990 pub name: [u8; 10],
19991}
19992impl NAMED_VALUE_FLOAT_DATA {
19993 pub const ENCODED_LEN: usize = 18usize;
19994 pub const DEFAULT: Self = Self {
19995 time_boot_ms: 0_u32,
19996 value: 0.0_f32,
19997 name: [0_u8; 10usize],
19998 };
19999 #[cfg(feature = "arbitrary")]
20000 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20001 use arbitrary::{Arbitrary, Unstructured};
20002 let mut buf = [0u8; 1024];
20003 rng.fill_bytes(&mut buf);
20004 let mut unstructured = Unstructured::new(&buf);
20005 Self::arbitrary(&mut unstructured).unwrap_or_default()
20006 }
20007}
20008impl Default for NAMED_VALUE_FLOAT_DATA {
20009 fn default() -> Self {
20010 Self::DEFAULT.clone()
20011 }
20012}
20013impl MessageData for NAMED_VALUE_FLOAT_DATA {
20014 type Message = MavMessage;
20015 const ID: u32 = 251u32;
20016 const NAME: &'static str = "NAMED_VALUE_FLOAT";
20017 const EXTRA_CRC: u8 = 170u8;
20018 const ENCODED_LEN: usize = 18usize;
20019 fn deser(
20020 _version: MavlinkVersion,
20021 __input: &[u8],
20022 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20023 let avail_len = __input.len();
20024 let mut payload_buf = [0; Self::ENCODED_LEN];
20025 let mut buf = if avail_len < Self::ENCODED_LEN {
20026 payload_buf[0..avail_len].copy_from_slice(__input);
20027 Bytes::new(&payload_buf)
20028 } else {
20029 Bytes::new(__input)
20030 };
20031 let mut __struct = Self::default();
20032 __struct.time_boot_ms = buf.get_u32_le();
20033 __struct.value = buf.get_f32_le();
20034 for v in &mut __struct.name {
20035 let val = buf.get_u8();
20036 *v = val;
20037 }
20038 Ok(__struct)
20039 }
20040 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20041 let mut __tmp = BytesMut::new(bytes);
20042 #[allow(clippy::absurd_extreme_comparisons)]
20043 #[allow(unused_comparisons)]
20044 if __tmp.remaining() < Self::ENCODED_LEN {
20045 panic!(
20046 "buffer is too small (need {} bytes, but got {})",
20047 Self::ENCODED_LEN,
20048 __tmp.remaining(),
20049 )
20050 }
20051 __tmp.put_u32_le(self.time_boot_ms);
20052 __tmp.put_f32_le(self.value);
20053 for val in &self.name {
20054 __tmp.put_u8(*val);
20055 }
20056 if matches!(version, MavlinkVersion::V2) {
20057 let len = __tmp.len();
20058 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20059 } else {
20060 __tmp.len()
20061 }
20062 }
20063}
20064#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20065#[doc = ""]
20066#[doc = "ID: 252"]
20067#[derive(Debug, Clone, PartialEq)]
20068#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20069#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20070pub struct NAMED_VALUE_INT_DATA {
20071 #[doc = "Timestamp (time since system boot)."]
20072 pub time_boot_ms: u32,
20073 #[doc = "Signed integer value"]
20074 pub value: i32,
20075 #[doc = "Name of the debug variable"]
20076 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20077 pub name: [u8; 10],
20078}
20079impl NAMED_VALUE_INT_DATA {
20080 pub const ENCODED_LEN: usize = 18usize;
20081 pub const DEFAULT: Self = Self {
20082 time_boot_ms: 0_u32,
20083 value: 0_i32,
20084 name: [0_u8; 10usize],
20085 };
20086 #[cfg(feature = "arbitrary")]
20087 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20088 use arbitrary::{Arbitrary, Unstructured};
20089 let mut buf = [0u8; 1024];
20090 rng.fill_bytes(&mut buf);
20091 let mut unstructured = Unstructured::new(&buf);
20092 Self::arbitrary(&mut unstructured).unwrap_or_default()
20093 }
20094}
20095impl Default for NAMED_VALUE_INT_DATA {
20096 fn default() -> Self {
20097 Self::DEFAULT.clone()
20098 }
20099}
20100impl MessageData for NAMED_VALUE_INT_DATA {
20101 type Message = MavMessage;
20102 const ID: u32 = 252u32;
20103 const NAME: &'static str = "NAMED_VALUE_INT";
20104 const EXTRA_CRC: u8 = 44u8;
20105 const ENCODED_LEN: usize = 18usize;
20106 fn deser(
20107 _version: MavlinkVersion,
20108 __input: &[u8],
20109 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20110 let avail_len = __input.len();
20111 let mut payload_buf = [0; Self::ENCODED_LEN];
20112 let mut buf = if avail_len < Self::ENCODED_LEN {
20113 payload_buf[0..avail_len].copy_from_slice(__input);
20114 Bytes::new(&payload_buf)
20115 } else {
20116 Bytes::new(__input)
20117 };
20118 let mut __struct = Self::default();
20119 __struct.time_boot_ms = buf.get_u32_le();
20120 __struct.value = buf.get_i32_le();
20121 for v in &mut __struct.name {
20122 let val = buf.get_u8();
20123 *v = val;
20124 }
20125 Ok(__struct)
20126 }
20127 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20128 let mut __tmp = BytesMut::new(bytes);
20129 #[allow(clippy::absurd_extreme_comparisons)]
20130 #[allow(unused_comparisons)]
20131 if __tmp.remaining() < Self::ENCODED_LEN {
20132 panic!(
20133 "buffer is too small (need {} bytes, but got {})",
20134 Self::ENCODED_LEN,
20135 __tmp.remaining(),
20136 )
20137 }
20138 __tmp.put_u32_le(self.time_boot_ms);
20139 __tmp.put_i32_le(self.value);
20140 for val in &self.name {
20141 __tmp.put_u8(*val);
20142 }
20143 if matches!(version, MavlinkVersion::V2) {
20144 let len = __tmp.len();
20145 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20146 } else {
20147 __tmp.len()
20148 }
20149 }
20150}
20151#[doc = "The state of the navigation and position controller."]
20152#[doc = ""]
20153#[doc = "ID: 62"]
20154#[derive(Debug, Clone, PartialEq)]
20155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20157pub struct NAV_CONTROLLER_OUTPUT_DATA {
20158 #[doc = "Current desired roll"]
20159 pub nav_roll: f32,
20160 #[doc = "Current desired pitch"]
20161 pub nav_pitch: f32,
20162 #[doc = "Current altitude error"]
20163 pub alt_error: f32,
20164 #[doc = "Current airspeed error"]
20165 pub aspd_error: f32,
20166 #[doc = "Current crosstrack error on x-y plane"]
20167 pub xtrack_error: f32,
20168 #[doc = "Current desired heading"]
20169 pub nav_bearing: i16,
20170 #[doc = "Bearing to current waypoint/target"]
20171 pub target_bearing: i16,
20172 #[doc = "Distance to active waypoint"]
20173 pub wp_dist: u16,
20174}
20175impl NAV_CONTROLLER_OUTPUT_DATA {
20176 pub const ENCODED_LEN: usize = 26usize;
20177 pub const DEFAULT: Self = Self {
20178 nav_roll: 0.0_f32,
20179 nav_pitch: 0.0_f32,
20180 alt_error: 0.0_f32,
20181 aspd_error: 0.0_f32,
20182 xtrack_error: 0.0_f32,
20183 nav_bearing: 0_i16,
20184 target_bearing: 0_i16,
20185 wp_dist: 0_u16,
20186 };
20187 #[cfg(feature = "arbitrary")]
20188 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20189 use arbitrary::{Arbitrary, Unstructured};
20190 let mut buf = [0u8; 1024];
20191 rng.fill_bytes(&mut buf);
20192 let mut unstructured = Unstructured::new(&buf);
20193 Self::arbitrary(&mut unstructured).unwrap_or_default()
20194 }
20195}
20196impl Default for NAV_CONTROLLER_OUTPUT_DATA {
20197 fn default() -> Self {
20198 Self::DEFAULT.clone()
20199 }
20200}
20201impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
20202 type Message = MavMessage;
20203 const ID: u32 = 62u32;
20204 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
20205 const EXTRA_CRC: u8 = 183u8;
20206 const ENCODED_LEN: usize = 26usize;
20207 fn deser(
20208 _version: MavlinkVersion,
20209 __input: &[u8],
20210 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20211 let avail_len = __input.len();
20212 let mut payload_buf = [0; Self::ENCODED_LEN];
20213 let mut buf = if avail_len < Self::ENCODED_LEN {
20214 payload_buf[0..avail_len].copy_from_slice(__input);
20215 Bytes::new(&payload_buf)
20216 } else {
20217 Bytes::new(__input)
20218 };
20219 let mut __struct = Self::default();
20220 __struct.nav_roll = buf.get_f32_le();
20221 __struct.nav_pitch = buf.get_f32_le();
20222 __struct.alt_error = buf.get_f32_le();
20223 __struct.aspd_error = buf.get_f32_le();
20224 __struct.xtrack_error = buf.get_f32_le();
20225 __struct.nav_bearing = buf.get_i16_le();
20226 __struct.target_bearing = buf.get_i16_le();
20227 __struct.wp_dist = buf.get_u16_le();
20228 Ok(__struct)
20229 }
20230 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20231 let mut __tmp = BytesMut::new(bytes);
20232 #[allow(clippy::absurd_extreme_comparisons)]
20233 #[allow(unused_comparisons)]
20234 if __tmp.remaining() < Self::ENCODED_LEN {
20235 panic!(
20236 "buffer is too small (need {} bytes, but got {})",
20237 Self::ENCODED_LEN,
20238 __tmp.remaining(),
20239 )
20240 }
20241 __tmp.put_f32_le(self.nav_roll);
20242 __tmp.put_f32_le(self.nav_pitch);
20243 __tmp.put_f32_le(self.alt_error);
20244 __tmp.put_f32_le(self.aspd_error);
20245 __tmp.put_f32_le(self.xtrack_error);
20246 __tmp.put_i16_le(self.nav_bearing);
20247 __tmp.put_i16_le(self.target_bearing);
20248 __tmp.put_u16_le(self.wp_dist);
20249 if matches!(version, MavlinkVersion::V2) {
20250 let len = __tmp.len();
20251 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20252 } else {
20253 __tmp.len()
20254 }
20255 }
20256}
20257#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
20258#[doc = ""]
20259#[doc = "ID: 330"]
20260#[derive(Debug, Clone, PartialEq)]
20261#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20262#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20263pub struct OBSTACLE_DISTANCE_DATA {
20264 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20265 pub time_usec: u64,
20266 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
20267 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20268 pub distances: [u16; 72],
20269 #[doc = "Minimum distance the sensor can measure."]
20270 pub min_distance: u16,
20271 #[doc = "Maximum distance the sensor can measure."]
20272 pub max_distance: u16,
20273 #[doc = "Class id of the distance sensor type."]
20274 pub sensor_type: MavDistanceSensor,
20275 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
20276 pub increment: u8,
20277 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
20278 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20279 pub increment_f: f32,
20280 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
20281 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20282 pub angle_offset: f32,
20283 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
20284 #[cfg_attr(feature = "serde", serde(default))]
20285 pub frame: MavFrame,
20286}
20287impl OBSTACLE_DISTANCE_DATA {
20288 pub const ENCODED_LEN: usize = 167usize;
20289 pub const DEFAULT: Self = Self {
20290 time_usec: 0_u64,
20291 distances: [0_u16; 72usize],
20292 min_distance: 0_u16,
20293 max_distance: 0_u16,
20294 sensor_type: MavDistanceSensor::DEFAULT,
20295 increment: 0_u8,
20296 increment_f: 0.0_f32,
20297 angle_offset: 0.0_f32,
20298 frame: MavFrame::DEFAULT,
20299 };
20300 #[cfg(feature = "arbitrary")]
20301 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20302 use arbitrary::{Arbitrary, Unstructured};
20303 let mut buf = [0u8; 1024];
20304 rng.fill_bytes(&mut buf);
20305 let mut unstructured = Unstructured::new(&buf);
20306 Self::arbitrary(&mut unstructured).unwrap_or_default()
20307 }
20308}
20309impl Default for OBSTACLE_DISTANCE_DATA {
20310 fn default() -> Self {
20311 Self::DEFAULT.clone()
20312 }
20313}
20314impl MessageData for OBSTACLE_DISTANCE_DATA {
20315 type Message = MavMessage;
20316 const ID: u32 = 330u32;
20317 const NAME: &'static str = "OBSTACLE_DISTANCE";
20318 const EXTRA_CRC: u8 = 23u8;
20319 const ENCODED_LEN: usize = 167usize;
20320 fn deser(
20321 _version: MavlinkVersion,
20322 __input: &[u8],
20323 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20324 let avail_len = __input.len();
20325 let mut payload_buf = [0; Self::ENCODED_LEN];
20326 let mut buf = if avail_len < Self::ENCODED_LEN {
20327 payload_buf[0..avail_len].copy_from_slice(__input);
20328 Bytes::new(&payload_buf)
20329 } else {
20330 Bytes::new(__input)
20331 };
20332 let mut __struct = Self::default();
20333 __struct.time_usec = buf.get_u64_le();
20334 for v in &mut __struct.distances {
20335 let val = buf.get_u16_le();
20336 *v = val;
20337 }
20338 __struct.min_distance = buf.get_u16_le();
20339 __struct.max_distance = buf.get_u16_le();
20340 let tmp = buf.get_u8();
20341 __struct.sensor_type =
20342 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20343 enum_type: "MavDistanceSensor",
20344 value: tmp as u32,
20345 })?;
20346 __struct.increment = buf.get_u8();
20347 __struct.increment_f = buf.get_f32_le();
20348 __struct.angle_offset = buf.get_f32_le();
20349 let tmp = buf.get_u8();
20350 __struct.frame =
20351 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20352 enum_type: "MavFrame",
20353 value: tmp as u32,
20354 })?;
20355 Ok(__struct)
20356 }
20357 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20358 let mut __tmp = BytesMut::new(bytes);
20359 #[allow(clippy::absurd_extreme_comparisons)]
20360 #[allow(unused_comparisons)]
20361 if __tmp.remaining() < Self::ENCODED_LEN {
20362 panic!(
20363 "buffer is too small (need {} bytes, but got {})",
20364 Self::ENCODED_LEN,
20365 __tmp.remaining(),
20366 )
20367 }
20368 __tmp.put_u64_le(self.time_usec);
20369 for val in &self.distances {
20370 __tmp.put_u16_le(*val);
20371 }
20372 __tmp.put_u16_le(self.min_distance);
20373 __tmp.put_u16_le(self.max_distance);
20374 __tmp.put_u8(self.sensor_type as u8);
20375 __tmp.put_u8(self.increment);
20376 if matches!(version, MavlinkVersion::V2) {
20377 __tmp.put_f32_le(self.increment_f);
20378 __tmp.put_f32_le(self.angle_offset);
20379 __tmp.put_u8(self.frame as u8);
20380 let len = __tmp.len();
20381 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20382 } else {
20383 __tmp.len()
20384 }
20385 }
20386}
20387#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
20388#[doc = ""]
20389#[doc = "ID: 331"]
20390#[derive(Debug, Clone, PartialEq)]
20391#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20392#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20393pub struct ODOMETRY_DATA {
20394 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20395 pub time_usec: u64,
20396 #[doc = "X Position"]
20397 pub x: f32,
20398 #[doc = "Y Position"]
20399 pub y: f32,
20400 #[doc = "Z Position"]
20401 pub z: f32,
20402 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
20403 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20404 pub q: [f32; 4],
20405 #[doc = "X linear speed"]
20406 pub vx: f32,
20407 #[doc = "Y linear speed"]
20408 pub vy: f32,
20409 #[doc = "Z linear speed"]
20410 pub vz: f32,
20411 #[doc = "Roll angular speed"]
20412 pub rollspeed: f32,
20413 #[doc = "Pitch angular speed"]
20414 pub pitchspeed: f32,
20415 #[doc = "Yaw angular speed"]
20416 pub yawspeed: f32,
20417 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20418 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20419 pub pose_covariance: [f32; 21],
20420 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20421 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20422 pub velocity_covariance: [f32; 21],
20423 #[doc = "Coordinate frame of reference for the pose data."]
20424 pub frame_id: MavFrame,
20425 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
20426 pub child_frame_id: MavFrame,
20427 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
20428 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20429 pub reset_counter: u8,
20430 #[doc = "Type of estimator that is providing the odometry."]
20431 #[cfg_attr(feature = "serde", serde(default))]
20432 pub estimator_type: MavEstimatorType,
20433 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
20434 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20435 pub quality: i8,
20436}
20437impl ODOMETRY_DATA {
20438 pub const ENCODED_LEN: usize = 233usize;
20439 pub const DEFAULT: Self = Self {
20440 time_usec: 0_u64,
20441 x: 0.0_f32,
20442 y: 0.0_f32,
20443 z: 0.0_f32,
20444 q: [0.0_f32; 4usize],
20445 vx: 0.0_f32,
20446 vy: 0.0_f32,
20447 vz: 0.0_f32,
20448 rollspeed: 0.0_f32,
20449 pitchspeed: 0.0_f32,
20450 yawspeed: 0.0_f32,
20451 pose_covariance: [0.0_f32; 21usize],
20452 velocity_covariance: [0.0_f32; 21usize],
20453 frame_id: MavFrame::DEFAULT,
20454 child_frame_id: MavFrame::DEFAULT,
20455 reset_counter: 0_u8,
20456 estimator_type: MavEstimatorType::DEFAULT,
20457 quality: 0_i8,
20458 };
20459 #[cfg(feature = "arbitrary")]
20460 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20461 use arbitrary::{Arbitrary, Unstructured};
20462 let mut buf = [0u8; 1024];
20463 rng.fill_bytes(&mut buf);
20464 let mut unstructured = Unstructured::new(&buf);
20465 Self::arbitrary(&mut unstructured).unwrap_or_default()
20466 }
20467}
20468impl Default for ODOMETRY_DATA {
20469 fn default() -> Self {
20470 Self::DEFAULT.clone()
20471 }
20472}
20473impl MessageData for ODOMETRY_DATA {
20474 type Message = MavMessage;
20475 const ID: u32 = 331u32;
20476 const NAME: &'static str = "ODOMETRY";
20477 const EXTRA_CRC: u8 = 91u8;
20478 const ENCODED_LEN: usize = 233usize;
20479 fn deser(
20480 _version: MavlinkVersion,
20481 __input: &[u8],
20482 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20483 let avail_len = __input.len();
20484 let mut payload_buf = [0; Self::ENCODED_LEN];
20485 let mut buf = if avail_len < Self::ENCODED_LEN {
20486 payload_buf[0..avail_len].copy_from_slice(__input);
20487 Bytes::new(&payload_buf)
20488 } else {
20489 Bytes::new(__input)
20490 };
20491 let mut __struct = Self::default();
20492 __struct.time_usec = buf.get_u64_le();
20493 __struct.x = buf.get_f32_le();
20494 __struct.y = buf.get_f32_le();
20495 __struct.z = buf.get_f32_le();
20496 for v in &mut __struct.q {
20497 let val = buf.get_f32_le();
20498 *v = val;
20499 }
20500 __struct.vx = buf.get_f32_le();
20501 __struct.vy = buf.get_f32_le();
20502 __struct.vz = buf.get_f32_le();
20503 __struct.rollspeed = buf.get_f32_le();
20504 __struct.pitchspeed = buf.get_f32_le();
20505 __struct.yawspeed = buf.get_f32_le();
20506 for v in &mut __struct.pose_covariance {
20507 let val = buf.get_f32_le();
20508 *v = val;
20509 }
20510 for v in &mut __struct.velocity_covariance {
20511 let val = buf.get_f32_le();
20512 *v = val;
20513 }
20514 let tmp = buf.get_u8();
20515 __struct.frame_id =
20516 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20517 enum_type: "MavFrame",
20518 value: tmp as u32,
20519 })?;
20520 let tmp = buf.get_u8();
20521 __struct.child_frame_id =
20522 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20523 enum_type: "MavFrame",
20524 value: tmp as u32,
20525 })?;
20526 __struct.reset_counter = buf.get_u8();
20527 let tmp = buf.get_u8();
20528 __struct.estimator_type =
20529 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20530 enum_type: "MavEstimatorType",
20531 value: tmp as u32,
20532 })?;
20533 __struct.quality = buf.get_i8();
20534 Ok(__struct)
20535 }
20536 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20537 let mut __tmp = BytesMut::new(bytes);
20538 #[allow(clippy::absurd_extreme_comparisons)]
20539 #[allow(unused_comparisons)]
20540 if __tmp.remaining() < Self::ENCODED_LEN {
20541 panic!(
20542 "buffer is too small (need {} bytes, but got {})",
20543 Self::ENCODED_LEN,
20544 __tmp.remaining(),
20545 )
20546 }
20547 __tmp.put_u64_le(self.time_usec);
20548 __tmp.put_f32_le(self.x);
20549 __tmp.put_f32_le(self.y);
20550 __tmp.put_f32_le(self.z);
20551 for val in &self.q {
20552 __tmp.put_f32_le(*val);
20553 }
20554 __tmp.put_f32_le(self.vx);
20555 __tmp.put_f32_le(self.vy);
20556 __tmp.put_f32_le(self.vz);
20557 __tmp.put_f32_le(self.rollspeed);
20558 __tmp.put_f32_le(self.pitchspeed);
20559 __tmp.put_f32_le(self.yawspeed);
20560 for val in &self.pose_covariance {
20561 __tmp.put_f32_le(*val);
20562 }
20563 for val in &self.velocity_covariance {
20564 __tmp.put_f32_le(*val);
20565 }
20566 __tmp.put_u8(self.frame_id as u8);
20567 __tmp.put_u8(self.child_frame_id as u8);
20568 if matches!(version, MavlinkVersion::V2) {
20569 __tmp.put_u8(self.reset_counter);
20570 __tmp.put_u8(self.estimator_type as u8);
20571 __tmp.put_i8(self.quality);
20572 let len = __tmp.len();
20573 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20574 } else {
20575 __tmp.len()
20576 }
20577 }
20578}
20579#[doc = "Hardware status sent by an onboard computer."]
20580#[doc = ""]
20581#[doc = "ID: 390"]
20582#[derive(Debug, Clone, PartialEq)]
20583#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20584#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20585pub struct ONBOARD_COMPUTER_STATUS_DATA {
20586 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20587 pub time_usec: u64,
20588 #[doc = "Time since system boot."]
20589 pub uptime: u32,
20590 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
20591 pub ram_usage: u32,
20592 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
20593 pub ram_total: u32,
20594 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
20595 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20596 pub storage_type: [u32; 4],
20597 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
20598 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20599 pub storage_usage: [u32; 4],
20600 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
20601 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20602 pub storage_total: [u32; 4],
20603 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
20604 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20605 pub link_type: [u32; 6],
20606 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
20607 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20608 pub link_tx_rate: [u32; 6],
20609 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
20610 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20611 pub link_rx_rate: [u32; 6],
20612 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
20613 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20614 pub link_tx_max: [u32; 6],
20615 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
20616 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20617 pub link_rx_max: [u32; 6],
20618 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
20619 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20620 pub fan_speed: [i16; 4],
20621 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
20622 pub mavtype: u8,
20623 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
20624 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20625 pub cpu_cores: [u8; 8],
20626 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
20627 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20628 pub cpu_combined: [u8; 10],
20629 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
20630 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20631 pub gpu_cores: [u8; 4],
20632 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
20633 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20634 pub gpu_combined: [u8; 10],
20635 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
20636 pub temperature_board: i8,
20637 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
20638 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20639 pub temperature_core: [i8; 8],
20640}
20641impl ONBOARD_COMPUTER_STATUS_DATA {
20642 pub const ENCODED_LEN: usize = 238usize;
20643 pub const DEFAULT: Self = Self {
20644 time_usec: 0_u64,
20645 uptime: 0_u32,
20646 ram_usage: 0_u32,
20647 ram_total: 0_u32,
20648 storage_type: [0_u32; 4usize],
20649 storage_usage: [0_u32; 4usize],
20650 storage_total: [0_u32; 4usize],
20651 link_type: [0_u32; 6usize],
20652 link_tx_rate: [0_u32; 6usize],
20653 link_rx_rate: [0_u32; 6usize],
20654 link_tx_max: [0_u32; 6usize],
20655 link_rx_max: [0_u32; 6usize],
20656 fan_speed: [0_i16; 4usize],
20657 mavtype: 0_u8,
20658 cpu_cores: [0_u8; 8usize],
20659 cpu_combined: [0_u8; 10usize],
20660 gpu_cores: [0_u8; 4usize],
20661 gpu_combined: [0_u8; 10usize],
20662 temperature_board: 0_i8,
20663 temperature_core: [0_i8; 8usize],
20664 };
20665 #[cfg(feature = "arbitrary")]
20666 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20667 use arbitrary::{Arbitrary, Unstructured};
20668 let mut buf = [0u8; 1024];
20669 rng.fill_bytes(&mut buf);
20670 let mut unstructured = Unstructured::new(&buf);
20671 Self::arbitrary(&mut unstructured).unwrap_or_default()
20672 }
20673}
20674impl Default for ONBOARD_COMPUTER_STATUS_DATA {
20675 fn default() -> Self {
20676 Self::DEFAULT.clone()
20677 }
20678}
20679impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
20680 type Message = MavMessage;
20681 const ID: u32 = 390u32;
20682 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
20683 const EXTRA_CRC: u8 = 156u8;
20684 const ENCODED_LEN: usize = 238usize;
20685 fn deser(
20686 _version: MavlinkVersion,
20687 __input: &[u8],
20688 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20689 let avail_len = __input.len();
20690 let mut payload_buf = [0; Self::ENCODED_LEN];
20691 let mut buf = if avail_len < Self::ENCODED_LEN {
20692 payload_buf[0..avail_len].copy_from_slice(__input);
20693 Bytes::new(&payload_buf)
20694 } else {
20695 Bytes::new(__input)
20696 };
20697 let mut __struct = Self::default();
20698 __struct.time_usec = buf.get_u64_le();
20699 __struct.uptime = buf.get_u32_le();
20700 __struct.ram_usage = buf.get_u32_le();
20701 __struct.ram_total = buf.get_u32_le();
20702 for v in &mut __struct.storage_type {
20703 let val = buf.get_u32_le();
20704 *v = val;
20705 }
20706 for v in &mut __struct.storage_usage {
20707 let val = buf.get_u32_le();
20708 *v = val;
20709 }
20710 for v in &mut __struct.storage_total {
20711 let val = buf.get_u32_le();
20712 *v = val;
20713 }
20714 for v in &mut __struct.link_type {
20715 let val = buf.get_u32_le();
20716 *v = val;
20717 }
20718 for v in &mut __struct.link_tx_rate {
20719 let val = buf.get_u32_le();
20720 *v = val;
20721 }
20722 for v in &mut __struct.link_rx_rate {
20723 let val = buf.get_u32_le();
20724 *v = val;
20725 }
20726 for v in &mut __struct.link_tx_max {
20727 let val = buf.get_u32_le();
20728 *v = val;
20729 }
20730 for v in &mut __struct.link_rx_max {
20731 let val = buf.get_u32_le();
20732 *v = val;
20733 }
20734 for v in &mut __struct.fan_speed {
20735 let val = buf.get_i16_le();
20736 *v = val;
20737 }
20738 __struct.mavtype = buf.get_u8();
20739 for v in &mut __struct.cpu_cores {
20740 let val = buf.get_u8();
20741 *v = val;
20742 }
20743 for v in &mut __struct.cpu_combined {
20744 let val = buf.get_u8();
20745 *v = val;
20746 }
20747 for v in &mut __struct.gpu_cores {
20748 let val = buf.get_u8();
20749 *v = val;
20750 }
20751 for v in &mut __struct.gpu_combined {
20752 let val = buf.get_u8();
20753 *v = val;
20754 }
20755 __struct.temperature_board = buf.get_i8();
20756 for v in &mut __struct.temperature_core {
20757 let val = buf.get_i8();
20758 *v = val;
20759 }
20760 Ok(__struct)
20761 }
20762 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20763 let mut __tmp = BytesMut::new(bytes);
20764 #[allow(clippy::absurd_extreme_comparisons)]
20765 #[allow(unused_comparisons)]
20766 if __tmp.remaining() < Self::ENCODED_LEN {
20767 panic!(
20768 "buffer is too small (need {} bytes, but got {})",
20769 Self::ENCODED_LEN,
20770 __tmp.remaining(),
20771 )
20772 }
20773 __tmp.put_u64_le(self.time_usec);
20774 __tmp.put_u32_le(self.uptime);
20775 __tmp.put_u32_le(self.ram_usage);
20776 __tmp.put_u32_le(self.ram_total);
20777 for val in &self.storage_type {
20778 __tmp.put_u32_le(*val);
20779 }
20780 for val in &self.storage_usage {
20781 __tmp.put_u32_le(*val);
20782 }
20783 for val in &self.storage_total {
20784 __tmp.put_u32_le(*val);
20785 }
20786 for val in &self.link_type {
20787 __tmp.put_u32_le(*val);
20788 }
20789 for val in &self.link_tx_rate {
20790 __tmp.put_u32_le(*val);
20791 }
20792 for val in &self.link_rx_rate {
20793 __tmp.put_u32_le(*val);
20794 }
20795 for val in &self.link_tx_max {
20796 __tmp.put_u32_le(*val);
20797 }
20798 for val in &self.link_rx_max {
20799 __tmp.put_u32_le(*val);
20800 }
20801 for val in &self.fan_speed {
20802 __tmp.put_i16_le(*val);
20803 }
20804 __tmp.put_u8(self.mavtype);
20805 for val in &self.cpu_cores {
20806 __tmp.put_u8(*val);
20807 }
20808 for val in &self.cpu_combined {
20809 __tmp.put_u8(*val);
20810 }
20811 for val in &self.gpu_cores {
20812 __tmp.put_u8(*val);
20813 }
20814 for val in &self.gpu_combined {
20815 __tmp.put_u8(*val);
20816 }
20817 __tmp.put_i8(self.temperature_board);
20818 for val in &self.temperature_core {
20819 __tmp.put_i8(*val);
20820 }
20821 if matches!(version, MavlinkVersion::V2) {
20822 let len = __tmp.len();
20823 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20824 } else {
20825 __tmp.len()
20826 }
20827 }
20828}
20829#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
20830#[doc = ""]
20831#[doc = "ID: 12918"]
20832#[derive(Debug, Clone, PartialEq)]
20833#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20834#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20835pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
20836 #[doc = "Status level indicating if arming is allowed."]
20837 pub status: MavOdidArmStatus,
20838 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
20839 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20840 pub error: [u8; 50],
20841}
20842impl OPEN_DRONE_ID_ARM_STATUS_DATA {
20843 pub const ENCODED_LEN: usize = 51usize;
20844 pub const DEFAULT: Self = Self {
20845 status: MavOdidArmStatus::DEFAULT,
20846 error: [0_u8; 50usize],
20847 };
20848 #[cfg(feature = "arbitrary")]
20849 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20850 use arbitrary::{Arbitrary, Unstructured};
20851 let mut buf = [0u8; 1024];
20852 rng.fill_bytes(&mut buf);
20853 let mut unstructured = Unstructured::new(&buf);
20854 Self::arbitrary(&mut unstructured).unwrap_or_default()
20855 }
20856}
20857impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
20858 fn default() -> Self {
20859 Self::DEFAULT.clone()
20860 }
20861}
20862impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
20863 type Message = MavMessage;
20864 const ID: u32 = 12918u32;
20865 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
20866 const EXTRA_CRC: u8 = 139u8;
20867 const ENCODED_LEN: usize = 51usize;
20868 fn deser(
20869 _version: MavlinkVersion,
20870 __input: &[u8],
20871 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20872 let avail_len = __input.len();
20873 let mut payload_buf = [0; Self::ENCODED_LEN];
20874 let mut buf = if avail_len < Self::ENCODED_LEN {
20875 payload_buf[0..avail_len].copy_from_slice(__input);
20876 Bytes::new(&payload_buf)
20877 } else {
20878 Bytes::new(__input)
20879 };
20880 let mut __struct = Self::default();
20881 let tmp = buf.get_u8();
20882 __struct.status =
20883 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20884 enum_type: "MavOdidArmStatus",
20885 value: tmp as u32,
20886 })?;
20887 for v in &mut __struct.error {
20888 let val = buf.get_u8();
20889 *v = val;
20890 }
20891 Ok(__struct)
20892 }
20893 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20894 let mut __tmp = BytesMut::new(bytes);
20895 #[allow(clippy::absurd_extreme_comparisons)]
20896 #[allow(unused_comparisons)]
20897 if __tmp.remaining() < Self::ENCODED_LEN {
20898 panic!(
20899 "buffer is too small (need {} bytes, but got {})",
20900 Self::ENCODED_LEN,
20901 __tmp.remaining(),
20902 )
20903 }
20904 __tmp.put_u8(self.status as u8);
20905 for val in &self.error {
20906 __tmp.put_u8(*val);
20907 }
20908 if matches!(version, MavlinkVersion::V2) {
20909 let len = __tmp.len();
20910 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20911 } else {
20912 __tmp.len()
20913 }
20914 }
20915}
20916#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
20917#[doc = ""]
20918#[doc = "ID: 12902"]
20919#[derive(Debug, Clone, PartialEq)]
20920#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20922pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
20923 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
20924 pub timestamp: u32,
20925 #[doc = "System ID (0 for broadcast)."]
20926 pub target_system: u8,
20927 #[doc = "Component ID (0 for broadcast)."]
20928 pub target_component: u8,
20929 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
20930 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20931 pub id_or_mac: [u8; 20],
20932 #[doc = "Indicates the type of authentication."]
20933 pub authentication_type: MavOdidAuthType,
20934 #[doc = "Allowed range is 0 - 15."]
20935 pub data_page: u8,
20936 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
20937 pub last_page_index: u8,
20938 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
20939 pub length: u8,
20940 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
20941 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20942 pub authentication_data: [u8; 23],
20943}
20944impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
20945 pub const ENCODED_LEN: usize = 53usize;
20946 pub const DEFAULT: Self = Self {
20947 timestamp: 0_u32,
20948 target_system: 0_u8,
20949 target_component: 0_u8,
20950 id_or_mac: [0_u8; 20usize],
20951 authentication_type: MavOdidAuthType::DEFAULT,
20952 data_page: 0_u8,
20953 last_page_index: 0_u8,
20954 length: 0_u8,
20955 authentication_data: [0_u8; 23usize],
20956 };
20957 #[cfg(feature = "arbitrary")]
20958 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20959 use arbitrary::{Arbitrary, Unstructured};
20960 let mut buf = [0u8; 1024];
20961 rng.fill_bytes(&mut buf);
20962 let mut unstructured = Unstructured::new(&buf);
20963 Self::arbitrary(&mut unstructured).unwrap_or_default()
20964 }
20965}
20966impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
20967 fn default() -> Self {
20968 Self::DEFAULT.clone()
20969 }
20970}
20971impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
20972 type Message = MavMessage;
20973 const ID: u32 = 12902u32;
20974 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
20975 const EXTRA_CRC: u8 = 140u8;
20976 const ENCODED_LEN: usize = 53usize;
20977 fn deser(
20978 _version: MavlinkVersion,
20979 __input: &[u8],
20980 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20981 let avail_len = __input.len();
20982 let mut payload_buf = [0; Self::ENCODED_LEN];
20983 let mut buf = if avail_len < Self::ENCODED_LEN {
20984 payload_buf[0..avail_len].copy_from_slice(__input);
20985 Bytes::new(&payload_buf)
20986 } else {
20987 Bytes::new(__input)
20988 };
20989 let mut __struct = Self::default();
20990 __struct.timestamp = buf.get_u32_le();
20991 __struct.target_system = buf.get_u8();
20992 __struct.target_component = buf.get_u8();
20993 for v in &mut __struct.id_or_mac {
20994 let val = buf.get_u8();
20995 *v = val;
20996 }
20997 let tmp = buf.get_u8();
20998 __struct.authentication_type =
20999 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21000 enum_type: "MavOdidAuthType",
21001 value: tmp as u32,
21002 })?;
21003 __struct.data_page = buf.get_u8();
21004 __struct.last_page_index = buf.get_u8();
21005 __struct.length = buf.get_u8();
21006 for v in &mut __struct.authentication_data {
21007 let val = buf.get_u8();
21008 *v = val;
21009 }
21010 Ok(__struct)
21011 }
21012 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21013 let mut __tmp = BytesMut::new(bytes);
21014 #[allow(clippy::absurd_extreme_comparisons)]
21015 #[allow(unused_comparisons)]
21016 if __tmp.remaining() < Self::ENCODED_LEN {
21017 panic!(
21018 "buffer is too small (need {} bytes, but got {})",
21019 Self::ENCODED_LEN,
21020 __tmp.remaining(),
21021 )
21022 }
21023 __tmp.put_u32_le(self.timestamp);
21024 __tmp.put_u8(self.target_system);
21025 __tmp.put_u8(self.target_component);
21026 for val in &self.id_or_mac {
21027 __tmp.put_u8(*val);
21028 }
21029 __tmp.put_u8(self.authentication_type as u8);
21030 __tmp.put_u8(self.data_page);
21031 __tmp.put_u8(self.last_page_index);
21032 __tmp.put_u8(self.length);
21033 for val in &self.authentication_data {
21034 __tmp.put_u8(*val);
21035 }
21036 if matches!(version, MavlinkVersion::V2) {
21037 let len = __tmp.len();
21038 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21039 } else {
21040 __tmp.len()
21041 }
21042 }
21043}
21044#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
21045#[doc = ""]
21046#[doc = "ID: 12900"]
21047#[derive(Debug, Clone, PartialEq)]
21048#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21049#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21050pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
21051 #[doc = "System ID (0 for broadcast)."]
21052 pub target_system: u8,
21053 #[doc = "Component ID (0 for broadcast)."]
21054 pub target_component: u8,
21055 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21056 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21057 pub id_or_mac: [u8; 20],
21058 #[doc = "Indicates the format for the uas_id field of this message."]
21059 pub id_type: MavOdidIdType,
21060 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
21061 pub ua_type: MavOdidUaType,
21062 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
21063 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21064 pub uas_id: [u8; 20],
21065}
21066impl OPEN_DRONE_ID_BASIC_ID_DATA {
21067 pub const ENCODED_LEN: usize = 44usize;
21068 pub const DEFAULT: Self = Self {
21069 target_system: 0_u8,
21070 target_component: 0_u8,
21071 id_or_mac: [0_u8; 20usize],
21072 id_type: MavOdidIdType::DEFAULT,
21073 ua_type: MavOdidUaType::DEFAULT,
21074 uas_id: [0_u8; 20usize],
21075 };
21076 #[cfg(feature = "arbitrary")]
21077 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21078 use arbitrary::{Arbitrary, Unstructured};
21079 let mut buf = [0u8; 1024];
21080 rng.fill_bytes(&mut buf);
21081 let mut unstructured = Unstructured::new(&buf);
21082 Self::arbitrary(&mut unstructured).unwrap_or_default()
21083 }
21084}
21085impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
21086 fn default() -> Self {
21087 Self::DEFAULT.clone()
21088 }
21089}
21090impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
21091 type Message = MavMessage;
21092 const ID: u32 = 12900u32;
21093 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
21094 const EXTRA_CRC: u8 = 114u8;
21095 const ENCODED_LEN: usize = 44usize;
21096 fn deser(
21097 _version: MavlinkVersion,
21098 __input: &[u8],
21099 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21100 let avail_len = __input.len();
21101 let mut payload_buf = [0; Self::ENCODED_LEN];
21102 let mut buf = if avail_len < Self::ENCODED_LEN {
21103 payload_buf[0..avail_len].copy_from_slice(__input);
21104 Bytes::new(&payload_buf)
21105 } else {
21106 Bytes::new(__input)
21107 };
21108 let mut __struct = Self::default();
21109 __struct.target_system = buf.get_u8();
21110 __struct.target_component = buf.get_u8();
21111 for v in &mut __struct.id_or_mac {
21112 let val = buf.get_u8();
21113 *v = val;
21114 }
21115 let tmp = buf.get_u8();
21116 __struct.id_type =
21117 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21118 enum_type: "MavOdidIdType",
21119 value: tmp as u32,
21120 })?;
21121 let tmp = buf.get_u8();
21122 __struct.ua_type =
21123 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21124 enum_type: "MavOdidUaType",
21125 value: tmp as u32,
21126 })?;
21127 for v in &mut __struct.uas_id {
21128 let val = buf.get_u8();
21129 *v = val;
21130 }
21131 Ok(__struct)
21132 }
21133 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21134 let mut __tmp = BytesMut::new(bytes);
21135 #[allow(clippy::absurd_extreme_comparisons)]
21136 #[allow(unused_comparisons)]
21137 if __tmp.remaining() < Self::ENCODED_LEN {
21138 panic!(
21139 "buffer is too small (need {} bytes, but got {})",
21140 Self::ENCODED_LEN,
21141 __tmp.remaining(),
21142 )
21143 }
21144 __tmp.put_u8(self.target_system);
21145 __tmp.put_u8(self.target_component);
21146 for val in &self.id_or_mac {
21147 __tmp.put_u8(*val);
21148 }
21149 __tmp.put_u8(self.id_type as u8);
21150 __tmp.put_u8(self.ua_type as u8);
21151 for val in &self.uas_id {
21152 __tmp.put_u8(*val);
21153 }
21154 if matches!(version, MavlinkVersion::V2) {
21155 let len = __tmp.len();
21156 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21157 } else {
21158 __tmp.len()
21159 }
21160 }
21161}
21162#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
21163#[doc = ""]
21164#[doc = "ID: 12901"]
21165#[derive(Debug, Clone, PartialEq)]
21166#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21168pub struct OPEN_DRONE_ID_LOCATION_DATA {
21169 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21170 pub latitude: i32,
21171 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21172 pub longitude: i32,
21173 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
21174 pub altitude_barometric: f32,
21175 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
21176 pub altitude_geodetic: f32,
21177 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
21178 pub height: f32,
21179 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
21180 pub timestamp: f32,
21181 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
21182 pub direction: u16,
21183 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
21184 pub speed_horizontal: u16,
21185 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
21186 pub speed_vertical: i16,
21187 #[doc = "System ID (0 for broadcast)."]
21188 pub target_system: u8,
21189 #[doc = "Component ID (0 for broadcast)."]
21190 pub target_component: u8,
21191 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21192 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21193 pub id_or_mac: [u8; 20],
21194 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
21195 pub status: MavOdidStatus,
21196 #[doc = "Indicates the reference point for the height field."]
21197 pub height_reference: MavOdidHeightRef,
21198 #[doc = "The accuracy of the horizontal position."]
21199 pub horizontal_accuracy: MavOdidHorAcc,
21200 #[doc = "The accuracy of the vertical position."]
21201 pub vertical_accuracy: MavOdidVerAcc,
21202 #[doc = "The accuracy of the barometric altitude."]
21203 pub barometer_accuracy: MavOdidVerAcc,
21204 #[doc = "The accuracy of the horizontal and vertical speed."]
21205 pub speed_accuracy: MavOdidSpeedAcc,
21206 #[doc = "The accuracy of the timestamps."]
21207 pub timestamp_accuracy: MavOdidTimeAcc,
21208}
21209impl OPEN_DRONE_ID_LOCATION_DATA {
21210 pub const ENCODED_LEN: usize = 59usize;
21211 pub const DEFAULT: Self = Self {
21212 latitude: 0_i32,
21213 longitude: 0_i32,
21214 altitude_barometric: 0.0_f32,
21215 altitude_geodetic: 0.0_f32,
21216 height: 0.0_f32,
21217 timestamp: 0.0_f32,
21218 direction: 0_u16,
21219 speed_horizontal: 0_u16,
21220 speed_vertical: 0_i16,
21221 target_system: 0_u8,
21222 target_component: 0_u8,
21223 id_or_mac: [0_u8; 20usize],
21224 status: MavOdidStatus::DEFAULT,
21225 height_reference: MavOdidHeightRef::DEFAULT,
21226 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
21227 vertical_accuracy: MavOdidVerAcc::DEFAULT,
21228 barometer_accuracy: MavOdidVerAcc::DEFAULT,
21229 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
21230 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
21231 };
21232 #[cfg(feature = "arbitrary")]
21233 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21234 use arbitrary::{Arbitrary, Unstructured};
21235 let mut buf = [0u8; 1024];
21236 rng.fill_bytes(&mut buf);
21237 let mut unstructured = Unstructured::new(&buf);
21238 Self::arbitrary(&mut unstructured).unwrap_or_default()
21239 }
21240}
21241impl Default for OPEN_DRONE_ID_LOCATION_DATA {
21242 fn default() -> Self {
21243 Self::DEFAULT.clone()
21244 }
21245}
21246impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
21247 type Message = MavMessage;
21248 const ID: u32 = 12901u32;
21249 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
21250 const EXTRA_CRC: u8 = 254u8;
21251 const ENCODED_LEN: usize = 59usize;
21252 fn deser(
21253 _version: MavlinkVersion,
21254 __input: &[u8],
21255 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21256 let avail_len = __input.len();
21257 let mut payload_buf = [0; Self::ENCODED_LEN];
21258 let mut buf = if avail_len < Self::ENCODED_LEN {
21259 payload_buf[0..avail_len].copy_from_slice(__input);
21260 Bytes::new(&payload_buf)
21261 } else {
21262 Bytes::new(__input)
21263 };
21264 let mut __struct = Self::default();
21265 __struct.latitude = buf.get_i32_le();
21266 __struct.longitude = buf.get_i32_le();
21267 __struct.altitude_barometric = buf.get_f32_le();
21268 __struct.altitude_geodetic = buf.get_f32_le();
21269 __struct.height = buf.get_f32_le();
21270 __struct.timestamp = buf.get_f32_le();
21271 __struct.direction = buf.get_u16_le();
21272 __struct.speed_horizontal = buf.get_u16_le();
21273 __struct.speed_vertical = buf.get_i16_le();
21274 __struct.target_system = buf.get_u8();
21275 __struct.target_component = buf.get_u8();
21276 for v in &mut __struct.id_or_mac {
21277 let val = buf.get_u8();
21278 *v = val;
21279 }
21280 let tmp = buf.get_u8();
21281 __struct.status =
21282 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21283 enum_type: "MavOdidStatus",
21284 value: tmp as u32,
21285 })?;
21286 let tmp = buf.get_u8();
21287 __struct.height_reference =
21288 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21289 enum_type: "MavOdidHeightRef",
21290 value: tmp as u32,
21291 })?;
21292 let tmp = buf.get_u8();
21293 __struct.horizontal_accuracy =
21294 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21295 enum_type: "MavOdidHorAcc",
21296 value: tmp as u32,
21297 })?;
21298 let tmp = buf.get_u8();
21299 __struct.vertical_accuracy =
21300 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21301 enum_type: "MavOdidVerAcc",
21302 value: tmp as u32,
21303 })?;
21304 let tmp = buf.get_u8();
21305 __struct.barometer_accuracy =
21306 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21307 enum_type: "MavOdidVerAcc",
21308 value: tmp as u32,
21309 })?;
21310 let tmp = buf.get_u8();
21311 __struct.speed_accuracy =
21312 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21313 enum_type: "MavOdidSpeedAcc",
21314 value: tmp as u32,
21315 })?;
21316 let tmp = buf.get_u8();
21317 __struct.timestamp_accuracy =
21318 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21319 enum_type: "MavOdidTimeAcc",
21320 value: tmp as u32,
21321 })?;
21322 Ok(__struct)
21323 }
21324 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21325 let mut __tmp = BytesMut::new(bytes);
21326 #[allow(clippy::absurd_extreme_comparisons)]
21327 #[allow(unused_comparisons)]
21328 if __tmp.remaining() < Self::ENCODED_LEN {
21329 panic!(
21330 "buffer is too small (need {} bytes, but got {})",
21331 Self::ENCODED_LEN,
21332 __tmp.remaining(),
21333 )
21334 }
21335 __tmp.put_i32_le(self.latitude);
21336 __tmp.put_i32_le(self.longitude);
21337 __tmp.put_f32_le(self.altitude_barometric);
21338 __tmp.put_f32_le(self.altitude_geodetic);
21339 __tmp.put_f32_le(self.height);
21340 __tmp.put_f32_le(self.timestamp);
21341 __tmp.put_u16_le(self.direction);
21342 __tmp.put_u16_le(self.speed_horizontal);
21343 __tmp.put_i16_le(self.speed_vertical);
21344 __tmp.put_u8(self.target_system);
21345 __tmp.put_u8(self.target_component);
21346 for val in &self.id_or_mac {
21347 __tmp.put_u8(*val);
21348 }
21349 __tmp.put_u8(self.status as u8);
21350 __tmp.put_u8(self.height_reference as u8);
21351 __tmp.put_u8(self.horizontal_accuracy as u8);
21352 __tmp.put_u8(self.vertical_accuracy as u8);
21353 __tmp.put_u8(self.barometer_accuracy as u8);
21354 __tmp.put_u8(self.speed_accuracy as u8);
21355 __tmp.put_u8(self.timestamp_accuracy as u8);
21356 if matches!(version, MavlinkVersion::V2) {
21357 let len = __tmp.len();
21358 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21359 } else {
21360 __tmp.len()
21361 }
21362 }
21363}
21364#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
21365#[doc = ""]
21366#[doc = "ID: 12915"]
21367#[derive(Debug, Clone, PartialEq)]
21368#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21369#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21370pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21371 #[doc = "System ID (0 for broadcast)."]
21372 pub target_system: u8,
21373 #[doc = "Component ID (0 for broadcast)."]
21374 pub target_component: u8,
21375 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21376 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21377 pub id_or_mac: [u8; 20],
21378 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
21379 pub single_message_size: u8,
21380 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
21381 pub msg_pack_size: u8,
21382 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
21383 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21384 pub messages: [u8; 225],
21385}
21386impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21387 pub const ENCODED_LEN: usize = 249usize;
21388 pub const DEFAULT: Self = Self {
21389 target_system: 0_u8,
21390 target_component: 0_u8,
21391 id_or_mac: [0_u8; 20usize],
21392 single_message_size: 0_u8,
21393 msg_pack_size: 0_u8,
21394 messages: [0_u8; 225usize],
21395 };
21396 #[cfg(feature = "arbitrary")]
21397 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21398 use arbitrary::{Arbitrary, Unstructured};
21399 let mut buf = [0u8; 1024];
21400 rng.fill_bytes(&mut buf);
21401 let mut unstructured = Unstructured::new(&buf);
21402 Self::arbitrary(&mut unstructured).unwrap_or_default()
21403 }
21404}
21405impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21406 fn default() -> Self {
21407 Self::DEFAULT.clone()
21408 }
21409}
21410impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21411 type Message = MavMessage;
21412 const ID: u32 = 12915u32;
21413 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
21414 const EXTRA_CRC: u8 = 94u8;
21415 const ENCODED_LEN: usize = 249usize;
21416 fn deser(
21417 _version: MavlinkVersion,
21418 __input: &[u8],
21419 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21420 let avail_len = __input.len();
21421 let mut payload_buf = [0; Self::ENCODED_LEN];
21422 let mut buf = if avail_len < Self::ENCODED_LEN {
21423 payload_buf[0..avail_len].copy_from_slice(__input);
21424 Bytes::new(&payload_buf)
21425 } else {
21426 Bytes::new(__input)
21427 };
21428 let mut __struct = Self::default();
21429 __struct.target_system = buf.get_u8();
21430 __struct.target_component = buf.get_u8();
21431 for v in &mut __struct.id_or_mac {
21432 let val = buf.get_u8();
21433 *v = val;
21434 }
21435 __struct.single_message_size = buf.get_u8();
21436 __struct.msg_pack_size = buf.get_u8();
21437 for v in &mut __struct.messages {
21438 let val = buf.get_u8();
21439 *v = val;
21440 }
21441 Ok(__struct)
21442 }
21443 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21444 let mut __tmp = BytesMut::new(bytes);
21445 #[allow(clippy::absurd_extreme_comparisons)]
21446 #[allow(unused_comparisons)]
21447 if __tmp.remaining() < Self::ENCODED_LEN {
21448 panic!(
21449 "buffer is too small (need {} bytes, but got {})",
21450 Self::ENCODED_LEN,
21451 __tmp.remaining(),
21452 )
21453 }
21454 __tmp.put_u8(self.target_system);
21455 __tmp.put_u8(self.target_component);
21456 for val in &self.id_or_mac {
21457 __tmp.put_u8(*val);
21458 }
21459 __tmp.put_u8(self.single_message_size);
21460 __tmp.put_u8(self.msg_pack_size);
21461 for val in &self.messages {
21462 __tmp.put_u8(*val);
21463 }
21464 if matches!(version, MavlinkVersion::V2) {
21465 let len = __tmp.len();
21466 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21467 } else {
21468 __tmp.len()
21469 }
21470 }
21471}
21472#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
21473#[doc = ""]
21474#[doc = "ID: 12905"]
21475#[derive(Debug, Clone, PartialEq)]
21476#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21477#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21478pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
21479 #[doc = "System ID (0 for broadcast)."]
21480 pub target_system: u8,
21481 #[doc = "Component ID (0 for broadcast)."]
21482 pub target_component: u8,
21483 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21484 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21485 pub id_or_mac: [u8; 20],
21486 #[doc = "Indicates the type of the operator_id field."]
21487 pub operator_id_type: MavOdidOperatorIdType,
21488 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
21489 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21490 pub operator_id: [u8; 20],
21491}
21492impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
21493 pub const ENCODED_LEN: usize = 43usize;
21494 pub const DEFAULT: Self = Self {
21495 target_system: 0_u8,
21496 target_component: 0_u8,
21497 id_or_mac: [0_u8; 20usize],
21498 operator_id_type: MavOdidOperatorIdType::DEFAULT,
21499 operator_id: [0_u8; 20usize],
21500 };
21501 #[cfg(feature = "arbitrary")]
21502 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21503 use arbitrary::{Arbitrary, Unstructured};
21504 let mut buf = [0u8; 1024];
21505 rng.fill_bytes(&mut buf);
21506 let mut unstructured = Unstructured::new(&buf);
21507 Self::arbitrary(&mut unstructured).unwrap_or_default()
21508 }
21509}
21510impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
21511 fn default() -> Self {
21512 Self::DEFAULT.clone()
21513 }
21514}
21515impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
21516 type Message = MavMessage;
21517 const ID: u32 = 12905u32;
21518 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
21519 const EXTRA_CRC: u8 = 49u8;
21520 const ENCODED_LEN: usize = 43usize;
21521 fn deser(
21522 _version: MavlinkVersion,
21523 __input: &[u8],
21524 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21525 let avail_len = __input.len();
21526 let mut payload_buf = [0; Self::ENCODED_LEN];
21527 let mut buf = if avail_len < Self::ENCODED_LEN {
21528 payload_buf[0..avail_len].copy_from_slice(__input);
21529 Bytes::new(&payload_buf)
21530 } else {
21531 Bytes::new(__input)
21532 };
21533 let mut __struct = Self::default();
21534 __struct.target_system = buf.get_u8();
21535 __struct.target_component = buf.get_u8();
21536 for v in &mut __struct.id_or_mac {
21537 let val = buf.get_u8();
21538 *v = val;
21539 }
21540 let tmp = buf.get_u8();
21541 __struct.operator_id_type =
21542 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21543 enum_type: "MavOdidOperatorIdType",
21544 value: tmp as u32,
21545 })?;
21546 for v in &mut __struct.operator_id {
21547 let val = buf.get_u8();
21548 *v = val;
21549 }
21550 Ok(__struct)
21551 }
21552 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21553 let mut __tmp = BytesMut::new(bytes);
21554 #[allow(clippy::absurd_extreme_comparisons)]
21555 #[allow(unused_comparisons)]
21556 if __tmp.remaining() < Self::ENCODED_LEN {
21557 panic!(
21558 "buffer is too small (need {} bytes, but got {})",
21559 Self::ENCODED_LEN,
21560 __tmp.remaining(),
21561 )
21562 }
21563 __tmp.put_u8(self.target_system);
21564 __tmp.put_u8(self.target_component);
21565 for val in &self.id_or_mac {
21566 __tmp.put_u8(*val);
21567 }
21568 __tmp.put_u8(self.operator_id_type as u8);
21569 for val in &self.operator_id {
21570 __tmp.put_u8(*val);
21571 }
21572 if matches!(version, MavlinkVersion::V2) {
21573 let len = __tmp.len();
21574 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21575 } else {
21576 __tmp.len()
21577 }
21578 }
21579}
21580#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
21581#[doc = ""]
21582#[doc = "ID: 12903"]
21583#[derive(Debug, Clone, PartialEq)]
21584#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21585#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21586pub struct OPEN_DRONE_ID_SELF_ID_DATA {
21587 #[doc = "System ID (0 for broadcast)."]
21588 pub target_system: u8,
21589 #[doc = "Component ID (0 for broadcast)."]
21590 pub target_component: u8,
21591 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21592 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21593 pub id_or_mac: [u8; 20],
21594 #[doc = "Indicates the type of the description field."]
21595 pub description_type: MavOdidDescType,
21596 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
21597 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21598 pub description: [u8; 23],
21599}
21600impl OPEN_DRONE_ID_SELF_ID_DATA {
21601 pub const ENCODED_LEN: usize = 46usize;
21602 pub const DEFAULT: Self = Self {
21603 target_system: 0_u8,
21604 target_component: 0_u8,
21605 id_or_mac: [0_u8; 20usize],
21606 description_type: MavOdidDescType::DEFAULT,
21607 description: [0_u8; 23usize],
21608 };
21609 #[cfg(feature = "arbitrary")]
21610 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21611 use arbitrary::{Arbitrary, Unstructured};
21612 let mut buf = [0u8; 1024];
21613 rng.fill_bytes(&mut buf);
21614 let mut unstructured = Unstructured::new(&buf);
21615 Self::arbitrary(&mut unstructured).unwrap_or_default()
21616 }
21617}
21618impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
21619 fn default() -> Self {
21620 Self::DEFAULT.clone()
21621 }
21622}
21623impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
21624 type Message = MavMessage;
21625 const ID: u32 = 12903u32;
21626 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
21627 const EXTRA_CRC: u8 = 249u8;
21628 const ENCODED_LEN: usize = 46usize;
21629 fn deser(
21630 _version: MavlinkVersion,
21631 __input: &[u8],
21632 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21633 let avail_len = __input.len();
21634 let mut payload_buf = [0; Self::ENCODED_LEN];
21635 let mut buf = if avail_len < Self::ENCODED_LEN {
21636 payload_buf[0..avail_len].copy_from_slice(__input);
21637 Bytes::new(&payload_buf)
21638 } else {
21639 Bytes::new(__input)
21640 };
21641 let mut __struct = Self::default();
21642 __struct.target_system = buf.get_u8();
21643 __struct.target_component = buf.get_u8();
21644 for v in &mut __struct.id_or_mac {
21645 let val = buf.get_u8();
21646 *v = val;
21647 }
21648 let tmp = buf.get_u8();
21649 __struct.description_type =
21650 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21651 enum_type: "MavOdidDescType",
21652 value: tmp as u32,
21653 })?;
21654 for v in &mut __struct.description {
21655 let val = buf.get_u8();
21656 *v = val;
21657 }
21658 Ok(__struct)
21659 }
21660 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21661 let mut __tmp = BytesMut::new(bytes);
21662 #[allow(clippy::absurd_extreme_comparisons)]
21663 #[allow(unused_comparisons)]
21664 if __tmp.remaining() < Self::ENCODED_LEN {
21665 panic!(
21666 "buffer is too small (need {} bytes, but got {})",
21667 Self::ENCODED_LEN,
21668 __tmp.remaining(),
21669 )
21670 }
21671 __tmp.put_u8(self.target_system);
21672 __tmp.put_u8(self.target_component);
21673 for val in &self.id_or_mac {
21674 __tmp.put_u8(*val);
21675 }
21676 __tmp.put_u8(self.description_type as u8);
21677 for val in &self.description {
21678 __tmp.put_u8(*val);
21679 }
21680 if matches!(version, MavlinkVersion::V2) {
21681 let len = __tmp.len();
21682 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21683 } else {
21684 __tmp.len()
21685 }
21686 }
21687}
21688#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
21689#[doc = ""]
21690#[doc = "ID: 12904"]
21691#[derive(Debug, Clone, PartialEq)]
21692#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21693#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21694pub struct OPEN_DRONE_ID_SYSTEM_DATA {
21695 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
21696 pub operator_latitude: i32,
21697 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
21698 pub operator_longitude: i32,
21699 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
21700 pub area_ceiling: f32,
21701 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
21702 pub area_floor: f32,
21703 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
21704 pub operator_altitude_geo: f32,
21705 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21706 pub timestamp: u32,
21707 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
21708 pub area_count: u16,
21709 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
21710 pub area_radius: u16,
21711 #[doc = "System ID (0 for broadcast)."]
21712 pub target_system: u8,
21713 #[doc = "Component ID (0 for broadcast)."]
21714 pub target_component: u8,
21715 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21716 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21717 pub id_or_mac: [u8; 20],
21718 #[doc = "Specifies the operator location type."]
21719 pub operator_location_type: MavOdidOperatorLocationType,
21720 #[doc = "Specifies the classification type of the UA."]
21721 pub classification_type: MavOdidClassificationType,
21722 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
21723 pub category_eu: MavOdidCategoryEu,
21724 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
21725 pub class_eu: MavOdidClassEu,
21726}
21727impl OPEN_DRONE_ID_SYSTEM_DATA {
21728 pub const ENCODED_LEN: usize = 54usize;
21729 pub const DEFAULT: Self = Self {
21730 operator_latitude: 0_i32,
21731 operator_longitude: 0_i32,
21732 area_ceiling: 0.0_f32,
21733 area_floor: 0.0_f32,
21734 operator_altitude_geo: 0.0_f32,
21735 timestamp: 0_u32,
21736 area_count: 0_u16,
21737 area_radius: 0_u16,
21738 target_system: 0_u8,
21739 target_component: 0_u8,
21740 id_or_mac: [0_u8; 20usize],
21741 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
21742 classification_type: MavOdidClassificationType::DEFAULT,
21743 category_eu: MavOdidCategoryEu::DEFAULT,
21744 class_eu: MavOdidClassEu::DEFAULT,
21745 };
21746 #[cfg(feature = "arbitrary")]
21747 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21748 use arbitrary::{Arbitrary, Unstructured};
21749 let mut buf = [0u8; 1024];
21750 rng.fill_bytes(&mut buf);
21751 let mut unstructured = Unstructured::new(&buf);
21752 Self::arbitrary(&mut unstructured).unwrap_or_default()
21753 }
21754}
21755impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
21756 fn default() -> Self {
21757 Self::DEFAULT.clone()
21758 }
21759}
21760impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
21761 type Message = MavMessage;
21762 const ID: u32 = 12904u32;
21763 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
21764 const EXTRA_CRC: u8 = 77u8;
21765 const ENCODED_LEN: usize = 54usize;
21766 fn deser(
21767 _version: MavlinkVersion,
21768 __input: &[u8],
21769 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21770 let avail_len = __input.len();
21771 let mut payload_buf = [0; Self::ENCODED_LEN];
21772 let mut buf = if avail_len < Self::ENCODED_LEN {
21773 payload_buf[0..avail_len].copy_from_slice(__input);
21774 Bytes::new(&payload_buf)
21775 } else {
21776 Bytes::new(__input)
21777 };
21778 let mut __struct = Self::default();
21779 __struct.operator_latitude = buf.get_i32_le();
21780 __struct.operator_longitude = buf.get_i32_le();
21781 __struct.area_ceiling = buf.get_f32_le();
21782 __struct.area_floor = buf.get_f32_le();
21783 __struct.operator_altitude_geo = buf.get_f32_le();
21784 __struct.timestamp = buf.get_u32_le();
21785 __struct.area_count = buf.get_u16_le();
21786 __struct.area_radius = buf.get_u16_le();
21787 __struct.target_system = buf.get_u8();
21788 __struct.target_component = buf.get_u8();
21789 for v in &mut __struct.id_or_mac {
21790 let val = buf.get_u8();
21791 *v = val;
21792 }
21793 let tmp = buf.get_u8();
21794 __struct.operator_location_type =
21795 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21796 enum_type: "MavOdidOperatorLocationType",
21797 value: tmp as u32,
21798 })?;
21799 let tmp = buf.get_u8();
21800 __struct.classification_type =
21801 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21802 enum_type: "MavOdidClassificationType",
21803 value: tmp as u32,
21804 })?;
21805 let tmp = buf.get_u8();
21806 __struct.category_eu =
21807 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21808 enum_type: "MavOdidCategoryEu",
21809 value: tmp as u32,
21810 })?;
21811 let tmp = buf.get_u8();
21812 __struct.class_eu =
21813 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21814 enum_type: "MavOdidClassEu",
21815 value: tmp as u32,
21816 })?;
21817 Ok(__struct)
21818 }
21819 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21820 let mut __tmp = BytesMut::new(bytes);
21821 #[allow(clippy::absurd_extreme_comparisons)]
21822 #[allow(unused_comparisons)]
21823 if __tmp.remaining() < Self::ENCODED_LEN {
21824 panic!(
21825 "buffer is too small (need {} bytes, but got {})",
21826 Self::ENCODED_LEN,
21827 __tmp.remaining(),
21828 )
21829 }
21830 __tmp.put_i32_le(self.operator_latitude);
21831 __tmp.put_i32_le(self.operator_longitude);
21832 __tmp.put_f32_le(self.area_ceiling);
21833 __tmp.put_f32_le(self.area_floor);
21834 __tmp.put_f32_le(self.operator_altitude_geo);
21835 __tmp.put_u32_le(self.timestamp);
21836 __tmp.put_u16_le(self.area_count);
21837 __tmp.put_u16_le(self.area_radius);
21838 __tmp.put_u8(self.target_system);
21839 __tmp.put_u8(self.target_component);
21840 for val in &self.id_or_mac {
21841 __tmp.put_u8(*val);
21842 }
21843 __tmp.put_u8(self.operator_location_type as u8);
21844 __tmp.put_u8(self.classification_type as u8);
21845 __tmp.put_u8(self.category_eu as u8);
21846 __tmp.put_u8(self.class_eu as u8);
21847 if matches!(version, MavlinkVersion::V2) {
21848 let len = __tmp.len();
21849 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21850 } else {
21851 __tmp.len()
21852 }
21853 }
21854}
21855#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
21856#[doc = ""]
21857#[doc = "ID: 12919"]
21858#[derive(Debug, Clone, PartialEq)]
21859#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21860#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21861pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21862 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
21863 pub operator_latitude: i32,
21864 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
21865 pub operator_longitude: i32,
21866 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
21867 pub operator_altitude_geo: f32,
21868 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21869 pub timestamp: u32,
21870 #[doc = "System ID (0 for broadcast)."]
21871 pub target_system: u8,
21872 #[doc = "Component ID (0 for broadcast)."]
21873 pub target_component: u8,
21874}
21875impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21876 pub const ENCODED_LEN: usize = 18usize;
21877 pub const DEFAULT: Self = Self {
21878 operator_latitude: 0_i32,
21879 operator_longitude: 0_i32,
21880 operator_altitude_geo: 0.0_f32,
21881 timestamp: 0_u32,
21882 target_system: 0_u8,
21883 target_component: 0_u8,
21884 };
21885 #[cfg(feature = "arbitrary")]
21886 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21887 use arbitrary::{Arbitrary, Unstructured};
21888 let mut buf = [0u8; 1024];
21889 rng.fill_bytes(&mut buf);
21890 let mut unstructured = Unstructured::new(&buf);
21891 Self::arbitrary(&mut unstructured).unwrap_or_default()
21892 }
21893}
21894impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21895 fn default() -> Self {
21896 Self::DEFAULT.clone()
21897 }
21898}
21899impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21900 type Message = MavMessage;
21901 const ID: u32 = 12919u32;
21902 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
21903 const EXTRA_CRC: u8 = 7u8;
21904 const ENCODED_LEN: usize = 18usize;
21905 fn deser(
21906 _version: MavlinkVersion,
21907 __input: &[u8],
21908 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21909 let avail_len = __input.len();
21910 let mut payload_buf = [0; Self::ENCODED_LEN];
21911 let mut buf = if avail_len < Self::ENCODED_LEN {
21912 payload_buf[0..avail_len].copy_from_slice(__input);
21913 Bytes::new(&payload_buf)
21914 } else {
21915 Bytes::new(__input)
21916 };
21917 let mut __struct = Self::default();
21918 __struct.operator_latitude = buf.get_i32_le();
21919 __struct.operator_longitude = buf.get_i32_le();
21920 __struct.operator_altitude_geo = buf.get_f32_le();
21921 __struct.timestamp = buf.get_u32_le();
21922 __struct.target_system = buf.get_u8();
21923 __struct.target_component = buf.get_u8();
21924 Ok(__struct)
21925 }
21926 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21927 let mut __tmp = BytesMut::new(bytes);
21928 #[allow(clippy::absurd_extreme_comparisons)]
21929 #[allow(unused_comparisons)]
21930 if __tmp.remaining() < Self::ENCODED_LEN {
21931 panic!(
21932 "buffer is too small (need {} bytes, but got {})",
21933 Self::ENCODED_LEN,
21934 __tmp.remaining(),
21935 )
21936 }
21937 __tmp.put_i32_le(self.operator_latitude);
21938 __tmp.put_i32_le(self.operator_longitude);
21939 __tmp.put_f32_le(self.operator_altitude_geo);
21940 __tmp.put_u32_le(self.timestamp);
21941 __tmp.put_u8(self.target_system);
21942 __tmp.put_u8(self.target_component);
21943 if matches!(version, MavlinkVersion::V2) {
21944 let len = __tmp.len();
21945 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21946 } else {
21947 __tmp.len()
21948 }
21949 }
21950}
21951#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
21952#[doc = ""]
21953#[doc = "ID: 100"]
21954#[derive(Debug, Clone, PartialEq)]
21955#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21956#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21957pub struct OPTICAL_FLOW_DATA {
21958 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21959 pub time_usec: u64,
21960 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
21961 pub flow_comp_m_x: f32,
21962 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
21963 pub flow_comp_m_y: f32,
21964 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
21965 pub ground_distance: f32,
21966 #[doc = "Flow in x-sensor direction"]
21967 pub flow_x: i16,
21968 #[doc = "Flow in y-sensor direction"]
21969 pub flow_y: i16,
21970 #[doc = "Sensor ID"]
21971 pub sensor_id: u8,
21972 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
21973 pub quality: u8,
21974 #[doc = "Flow rate about X axis"]
21975 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21976 pub flow_rate_x: f32,
21977 #[doc = "Flow rate about Y axis"]
21978 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21979 pub flow_rate_y: f32,
21980}
21981impl OPTICAL_FLOW_DATA {
21982 pub const ENCODED_LEN: usize = 34usize;
21983 pub const DEFAULT: Self = Self {
21984 time_usec: 0_u64,
21985 flow_comp_m_x: 0.0_f32,
21986 flow_comp_m_y: 0.0_f32,
21987 ground_distance: 0.0_f32,
21988 flow_x: 0_i16,
21989 flow_y: 0_i16,
21990 sensor_id: 0_u8,
21991 quality: 0_u8,
21992 flow_rate_x: 0.0_f32,
21993 flow_rate_y: 0.0_f32,
21994 };
21995 #[cfg(feature = "arbitrary")]
21996 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21997 use arbitrary::{Arbitrary, Unstructured};
21998 let mut buf = [0u8; 1024];
21999 rng.fill_bytes(&mut buf);
22000 let mut unstructured = Unstructured::new(&buf);
22001 Self::arbitrary(&mut unstructured).unwrap_or_default()
22002 }
22003}
22004impl Default for OPTICAL_FLOW_DATA {
22005 fn default() -> Self {
22006 Self::DEFAULT.clone()
22007 }
22008}
22009impl MessageData for OPTICAL_FLOW_DATA {
22010 type Message = MavMessage;
22011 const ID: u32 = 100u32;
22012 const NAME: &'static str = "OPTICAL_FLOW";
22013 const EXTRA_CRC: u8 = 175u8;
22014 const ENCODED_LEN: usize = 34usize;
22015 fn deser(
22016 _version: MavlinkVersion,
22017 __input: &[u8],
22018 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22019 let avail_len = __input.len();
22020 let mut payload_buf = [0; Self::ENCODED_LEN];
22021 let mut buf = if avail_len < Self::ENCODED_LEN {
22022 payload_buf[0..avail_len].copy_from_slice(__input);
22023 Bytes::new(&payload_buf)
22024 } else {
22025 Bytes::new(__input)
22026 };
22027 let mut __struct = Self::default();
22028 __struct.time_usec = buf.get_u64_le();
22029 __struct.flow_comp_m_x = buf.get_f32_le();
22030 __struct.flow_comp_m_y = buf.get_f32_le();
22031 __struct.ground_distance = buf.get_f32_le();
22032 __struct.flow_x = buf.get_i16_le();
22033 __struct.flow_y = buf.get_i16_le();
22034 __struct.sensor_id = buf.get_u8();
22035 __struct.quality = buf.get_u8();
22036 __struct.flow_rate_x = buf.get_f32_le();
22037 __struct.flow_rate_y = buf.get_f32_le();
22038 Ok(__struct)
22039 }
22040 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22041 let mut __tmp = BytesMut::new(bytes);
22042 #[allow(clippy::absurd_extreme_comparisons)]
22043 #[allow(unused_comparisons)]
22044 if __tmp.remaining() < Self::ENCODED_LEN {
22045 panic!(
22046 "buffer is too small (need {} bytes, but got {})",
22047 Self::ENCODED_LEN,
22048 __tmp.remaining(),
22049 )
22050 }
22051 __tmp.put_u64_le(self.time_usec);
22052 __tmp.put_f32_le(self.flow_comp_m_x);
22053 __tmp.put_f32_le(self.flow_comp_m_y);
22054 __tmp.put_f32_le(self.ground_distance);
22055 __tmp.put_i16_le(self.flow_x);
22056 __tmp.put_i16_le(self.flow_y);
22057 __tmp.put_u8(self.sensor_id);
22058 __tmp.put_u8(self.quality);
22059 if matches!(version, MavlinkVersion::V2) {
22060 __tmp.put_f32_le(self.flow_rate_x);
22061 __tmp.put_f32_le(self.flow_rate_y);
22062 let len = __tmp.len();
22063 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22064 } else {
22065 __tmp.len()
22066 }
22067 }
22068}
22069#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
22070#[doc = ""]
22071#[doc = "ID: 106"]
22072#[derive(Debug, Clone, PartialEq)]
22073#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22074#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22075pub struct OPTICAL_FLOW_RAD_DATA {
22076 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22077 pub time_usec: u64,
22078 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
22079 pub integration_time_us: u32,
22080 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
22081 pub integrated_x: f32,
22082 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
22083 pub integrated_y: f32,
22084 #[doc = "RH rotation around X axis"]
22085 pub integrated_xgyro: f32,
22086 #[doc = "RH rotation around Y axis"]
22087 pub integrated_ygyro: f32,
22088 #[doc = "RH rotation around Z axis"]
22089 pub integrated_zgyro: f32,
22090 #[doc = "Time since the distance was sampled."]
22091 pub time_delta_distance_us: u32,
22092 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
22093 pub distance: f32,
22094 #[doc = "Temperature"]
22095 pub temperature: i16,
22096 #[doc = "Sensor ID"]
22097 pub sensor_id: u8,
22098 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
22099 pub quality: u8,
22100}
22101impl OPTICAL_FLOW_RAD_DATA {
22102 pub const ENCODED_LEN: usize = 44usize;
22103 pub const DEFAULT: Self = Self {
22104 time_usec: 0_u64,
22105 integration_time_us: 0_u32,
22106 integrated_x: 0.0_f32,
22107 integrated_y: 0.0_f32,
22108 integrated_xgyro: 0.0_f32,
22109 integrated_ygyro: 0.0_f32,
22110 integrated_zgyro: 0.0_f32,
22111 time_delta_distance_us: 0_u32,
22112 distance: 0.0_f32,
22113 temperature: 0_i16,
22114 sensor_id: 0_u8,
22115 quality: 0_u8,
22116 };
22117 #[cfg(feature = "arbitrary")]
22118 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22119 use arbitrary::{Arbitrary, Unstructured};
22120 let mut buf = [0u8; 1024];
22121 rng.fill_bytes(&mut buf);
22122 let mut unstructured = Unstructured::new(&buf);
22123 Self::arbitrary(&mut unstructured).unwrap_or_default()
22124 }
22125}
22126impl Default for OPTICAL_FLOW_RAD_DATA {
22127 fn default() -> Self {
22128 Self::DEFAULT.clone()
22129 }
22130}
22131impl MessageData for OPTICAL_FLOW_RAD_DATA {
22132 type Message = MavMessage;
22133 const ID: u32 = 106u32;
22134 const NAME: &'static str = "OPTICAL_FLOW_RAD";
22135 const EXTRA_CRC: u8 = 138u8;
22136 const ENCODED_LEN: usize = 44usize;
22137 fn deser(
22138 _version: MavlinkVersion,
22139 __input: &[u8],
22140 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22141 let avail_len = __input.len();
22142 let mut payload_buf = [0; Self::ENCODED_LEN];
22143 let mut buf = if avail_len < Self::ENCODED_LEN {
22144 payload_buf[0..avail_len].copy_from_slice(__input);
22145 Bytes::new(&payload_buf)
22146 } else {
22147 Bytes::new(__input)
22148 };
22149 let mut __struct = Self::default();
22150 __struct.time_usec = buf.get_u64_le();
22151 __struct.integration_time_us = buf.get_u32_le();
22152 __struct.integrated_x = buf.get_f32_le();
22153 __struct.integrated_y = buf.get_f32_le();
22154 __struct.integrated_xgyro = buf.get_f32_le();
22155 __struct.integrated_ygyro = buf.get_f32_le();
22156 __struct.integrated_zgyro = buf.get_f32_le();
22157 __struct.time_delta_distance_us = buf.get_u32_le();
22158 __struct.distance = buf.get_f32_le();
22159 __struct.temperature = buf.get_i16_le();
22160 __struct.sensor_id = buf.get_u8();
22161 __struct.quality = buf.get_u8();
22162 Ok(__struct)
22163 }
22164 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22165 let mut __tmp = BytesMut::new(bytes);
22166 #[allow(clippy::absurd_extreme_comparisons)]
22167 #[allow(unused_comparisons)]
22168 if __tmp.remaining() < Self::ENCODED_LEN {
22169 panic!(
22170 "buffer is too small (need {} bytes, but got {})",
22171 Self::ENCODED_LEN,
22172 __tmp.remaining(),
22173 )
22174 }
22175 __tmp.put_u64_le(self.time_usec);
22176 __tmp.put_u32_le(self.integration_time_us);
22177 __tmp.put_f32_le(self.integrated_x);
22178 __tmp.put_f32_le(self.integrated_y);
22179 __tmp.put_f32_le(self.integrated_xgyro);
22180 __tmp.put_f32_le(self.integrated_ygyro);
22181 __tmp.put_f32_le(self.integrated_zgyro);
22182 __tmp.put_u32_le(self.time_delta_distance_us);
22183 __tmp.put_f32_le(self.distance);
22184 __tmp.put_i16_le(self.temperature);
22185 __tmp.put_u8(self.sensor_id);
22186 __tmp.put_u8(self.quality);
22187 if matches!(version, MavlinkVersion::V2) {
22188 let len = __tmp.len();
22189 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22190 } else {
22191 __tmp.len()
22192 }
22193 }
22194}
22195#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
22196#[doc = ""]
22197#[doc = "ID: 360"]
22198#[derive(Debug, Clone, PartialEq)]
22199#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22200#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22201pub struct ORBIT_EXECUTION_STATUS_DATA {
22202 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22203 pub time_usec: u64,
22204 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
22205 pub radius: f32,
22206 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22207 pub x: i32,
22208 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22209 pub y: i32,
22210 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
22211 pub z: f32,
22212 #[doc = "The coordinate system of the fields: x, y, z."]
22213 pub frame: MavFrame,
22214}
22215impl ORBIT_EXECUTION_STATUS_DATA {
22216 pub const ENCODED_LEN: usize = 25usize;
22217 pub const DEFAULT: Self = Self {
22218 time_usec: 0_u64,
22219 radius: 0.0_f32,
22220 x: 0_i32,
22221 y: 0_i32,
22222 z: 0.0_f32,
22223 frame: MavFrame::DEFAULT,
22224 };
22225 #[cfg(feature = "arbitrary")]
22226 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22227 use arbitrary::{Arbitrary, Unstructured};
22228 let mut buf = [0u8; 1024];
22229 rng.fill_bytes(&mut buf);
22230 let mut unstructured = Unstructured::new(&buf);
22231 Self::arbitrary(&mut unstructured).unwrap_or_default()
22232 }
22233}
22234impl Default for ORBIT_EXECUTION_STATUS_DATA {
22235 fn default() -> Self {
22236 Self::DEFAULT.clone()
22237 }
22238}
22239impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
22240 type Message = MavMessage;
22241 const ID: u32 = 360u32;
22242 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
22243 const EXTRA_CRC: u8 = 11u8;
22244 const ENCODED_LEN: usize = 25usize;
22245 fn deser(
22246 _version: MavlinkVersion,
22247 __input: &[u8],
22248 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22249 let avail_len = __input.len();
22250 let mut payload_buf = [0; Self::ENCODED_LEN];
22251 let mut buf = if avail_len < Self::ENCODED_LEN {
22252 payload_buf[0..avail_len].copy_from_slice(__input);
22253 Bytes::new(&payload_buf)
22254 } else {
22255 Bytes::new(__input)
22256 };
22257 let mut __struct = Self::default();
22258 __struct.time_usec = buf.get_u64_le();
22259 __struct.radius = buf.get_f32_le();
22260 __struct.x = buf.get_i32_le();
22261 __struct.y = buf.get_i32_le();
22262 __struct.z = buf.get_f32_le();
22263 let tmp = buf.get_u8();
22264 __struct.frame =
22265 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22266 enum_type: "MavFrame",
22267 value: tmp as u32,
22268 })?;
22269 Ok(__struct)
22270 }
22271 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22272 let mut __tmp = BytesMut::new(bytes);
22273 #[allow(clippy::absurd_extreme_comparisons)]
22274 #[allow(unused_comparisons)]
22275 if __tmp.remaining() < Self::ENCODED_LEN {
22276 panic!(
22277 "buffer is too small (need {} bytes, but got {})",
22278 Self::ENCODED_LEN,
22279 __tmp.remaining(),
22280 )
22281 }
22282 __tmp.put_u64_le(self.time_usec);
22283 __tmp.put_f32_le(self.radius);
22284 __tmp.put_i32_le(self.x);
22285 __tmp.put_i32_le(self.y);
22286 __tmp.put_f32_le(self.z);
22287 __tmp.put_u8(self.frame as u8);
22288 if matches!(version, MavlinkVersion::V2) {
22289 let len = __tmp.len();
22290 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22291 } else {
22292 __tmp.len()
22293 }
22294 }
22295}
22296#[doc = "Response from a PARAM_EXT_SET message."]
22297#[doc = ""]
22298#[doc = "ID: 324"]
22299#[derive(Debug, Clone, PartialEq)]
22300#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22301#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22302pub struct PARAM_EXT_ACK_DATA {
22303 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22304 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22305 pub param_id: [u8; 16],
22306 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
22307 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22308 pub param_value: [u8; 128],
22309 #[doc = "Parameter type."]
22310 pub param_type: MavParamExtType,
22311 #[doc = "Result code."]
22312 pub param_result: ParamAck,
22313}
22314impl PARAM_EXT_ACK_DATA {
22315 pub const ENCODED_LEN: usize = 146usize;
22316 pub const DEFAULT: Self = Self {
22317 param_id: [0_u8; 16usize],
22318 param_value: [0_u8; 128usize],
22319 param_type: MavParamExtType::DEFAULT,
22320 param_result: ParamAck::DEFAULT,
22321 };
22322 #[cfg(feature = "arbitrary")]
22323 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22324 use arbitrary::{Arbitrary, Unstructured};
22325 let mut buf = [0u8; 1024];
22326 rng.fill_bytes(&mut buf);
22327 let mut unstructured = Unstructured::new(&buf);
22328 Self::arbitrary(&mut unstructured).unwrap_or_default()
22329 }
22330}
22331impl Default for PARAM_EXT_ACK_DATA {
22332 fn default() -> Self {
22333 Self::DEFAULT.clone()
22334 }
22335}
22336impl MessageData for PARAM_EXT_ACK_DATA {
22337 type Message = MavMessage;
22338 const ID: u32 = 324u32;
22339 const NAME: &'static str = "PARAM_EXT_ACK";
22340 const EXTRA_CRC: u8 = 132u8;
22341 const ENCODED_LEN: usize = 146usize;
22342 fn deser(
22343 _version: MavlinkVersion,
22344 __input: &[u8],
22345 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22346 let avail_len = __input.len();
22347 let mut payload_buf = [0; Self::ENCODED_LEN];
22348 let mut buf = if avail_len < Self::ENCODED_LEN {
22349 payload_buf[0..avail_len].copy_from_slice(__input);
22350 Bytes::new(&payload_buf)
22351 } else {
22352 Bytes::new(__input)
22353 };
22354 let mut __struct = Self::default();
22355 for v in &mut __struct.param_id {
22356 let val = buf.get_u8();
22357 *v = val;
22358 }
22359 for v in &mut __struct.param_value {
22360 let val = buf.get_u8();
22361 *v = val;
22362 }
22363 let tmp = buf.get_u8();
22364 __struct.param_type =
22365 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22366 enum_type: "MavParamExtType",
22367 value: tmp as u32,
22368 })?;
22369 let tmp = buf.get_u8();
22370 __struct.param_result =
22371 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22372 enum_type: "ParamAck",
22373 value: tmp as u32,
22374 })?;
22375 Ok(__struct)
22376 }
22377 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22378 let mut __tmp = BytesMut::new(bytes);
22379 #[allow(clippy::absurd_extreme_comparisons)]
22380 #[allow(unused_comparisons)]
22381 if __tmp.remaining() < Self::ENCODED_LEN {
22382 panic!(
22383 "buffer is too small (need {} bytes, but got {})",
22384 Self::ENCODED_LEN,
22385 __tmp.remaining(),
22386 )
22387 }
22388 for val in &self.param_id {
22389 __tmp.put_u8(*val);
22390 }
22391 for val in &self.param_value {
22392 __tmp.put_u8(*val);
22393 }
22394 __tmp.put_u8(self.param_type as u8);
22395 __tmp.put_u8(self.param_result as u8);
22396 if matches!(version, MavlinkVersion::V2) {
22397 let len = __tmp.len();
22398 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22399 } else {
22400 __tmp.len()
22401 }
22402 }
22403}
22404#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
22405#[doc = ""]
22406#[doc = "ID: 321"]
22407#[derive(Debug, Clone, PartialEq)]
22408#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22409#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22410pub struct PARAM_EXT_REQUEST_LIST_DATA {
22411 #[doc = "System ID"]
22412 pub target_system: u8,
22413 #[doc = "Component ID"]
22414 pub target_component: u8,
22415}
22416impl PARAM_EXT_REQUEST_LIST_DATA {
22417 pub const ENCODED_LEN: usize = 2usize;
22418 pub const DEFAULT: Self = Self {
22419 target_system: 0_u8,
22420 target_component: 0_u8,
22421 };
22422 #[cfg(feature = "arbitrary")]
22423 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22424 use arbitrary::{Arbitrary, Unstructured};
22425 let mut buf = [0u8; 1024];
22426 rng.fill_bytes(&mut buf);
22427 let mut unstructured = Unstructured::new(&buf);
22428 Self::arbitrary(&mut unstructured).unwrap_or_default()
22429 }
22430}
22431impl Default for PARAM_EXT_REQUEST_LIST_DATA {
22432 fn default() -> Self {
22433 Self::DEFAULT.clone()
22434 }
22435}
22436impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
22437 type Message = MavMessage;
22438 const ID: u32 = 321u32;
22439 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
22440 const EXTRA_CRC: u8 = 88u8;
22441 const ENCODED_LEN: usize = 2usize;
22442 fn deser(
22443 _version: MavlinkVersion,
22444 __input: &[u8],
22445 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22446 let avail_len = __input.len();
22447 let mut payload_buf = [0; Self::ENCODED_LEN];
22448 let mut buf = if avail_len < Self::ENCODED_LEN {
22449 payload_buf[0..avail_len].copy_from_slice(__input);
22450 Bytes::new(&payload_buf)
22451 } else {
22452 Bytes::new(__input)
22453 };
22454 let mut __struct = Self::default();
22455 __struct.target_system = buf.get_u8();
22456 __struct.target_component = buf.get_u8();
22457 Ok(__struct)
22458 }
22459 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22460 let mut __tmp = BytesMut::new(bytes);
22461 #[allow(clippy::absurd_extreme_comparisons)]
22462 #[allow(unused_comparisons)]
22463 if __tmp.remaining() < Self::ENCODED_LEN {
22464 panic!(
22465 "buffer is too small (need {} bytes, but got {})",
22466 Self::ENCODED_LEN,
22467 __tmp.remaining(),
22468 )
22469 }
22470 __tmp.put_u8(self.target_system);
22471 __tmp.put_u8(self.target_component);
22472 if matches!(version, MavlinkVersion::V2) {
22473 let len = __tmp.len();
22474 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22475 } else {
22476 __tmp.len()
22477 }
22478 }
22479}
22480#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
22481#[doc = ""]
22482#[doc = "ID: 320"]
22483#[derive(Debug, Clone, PartialEq)]
22484#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22485#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22486pub struct PARAM_EXT_REQUEST_READ_DATA {
22487 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
22488 pub param_index: i16,
22489 #[doc = "System ID"]
22490 pub target_system: u8,
22491 #[doc = "Component ID"]
22492 pub target_component: u8,
22493 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22494 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22495 pub param_id: [u8; 16],
22496}
22497impl PARAM_EXT_REQUEST_READ_DATA {
22498 pub const ENCODED_LEN: usize = 20usize;
22499 pub const DEFAULT: Self = Self {
22500 param_index: 0_i16,
22501 target_system: 0_u8,
22502 target_component: 0_u8,
22503 param_id: [0_u8; 16usize],
22504 };
22505 #[cfg(feature = "arbitrary")]
22506 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22507 use arbitrary::{Arbitrary, Unstructured};
22508 let mut buf = [0u8; 1024];
22509 rng.fill_bytes(&mut buf);
22510 let mut unstructured = Unstructured::new(&buf);
22511 Self::arbitrary(&mut unstructured).unwrap_or_default()
22512 }
22513}
22514impl Default for PARAM_EXT_REQUEST_READ_DATA {
22515 fn default() -> Self {
22516 Self::DEFAULT.clone()
22517 }
22518}
22519impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
22520 type Message = MavMessage;
22521 const ID: u32 = 320u32;
22522 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
22523 const EXTRA_CRC: u8 = 243u8;
22524 const ENCODED_LEN: usize = 20usize;
22525 fn deser(
22526 _version: MavlinkVersion,
22527 __input: &[u8],
22528 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22529 let avail_len = __input.len();
22530 let mut payload_buf = [0; Self::ENCODED_LEN];
22531 let mut buf = if avail_len < Self::ENCODED_LEN {
22532 payload_buf[0..avail_len].copy_from_slice(__input);
22533 Bytes::new(&payload_buf)
22534 } else {
22535 Bytes::new(__input)
22536 };
22537 let mut __struct = Self::default();
22538 __struct.param_index = buf.get_i16_le();
22539 __struct.target_system = buf.get_u8();
22540 __struct.target_component = buf.get_u8();
22541 for v in &mut __struct.param_id {
22542 let val = buf.get_u8();
22543 *v = val;
22544 }
22545 Ok(__struct)
22546 }
22547 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22548 let mut __tmp = BytesMut::new(bytes);
22549 #[allow(clippy::absurd_extreme_comparisons)]
22550 #[allow(unused_comparisons)]
22551 if __tmp.remaining() < Self::ENCODED_LEN {
22552 panic!(
22553 "buffer is too small (need {} bytes, but got {})",
22554 Self::ENCODED_LEN,
22555 __tmp.remaining(),
22556 )
22557 }
22558 __tmp.put_i16_le(self.param_index);
22559 __tmp.put_u8(self.target_system);
22560 __tmp.put_u8(self.target_component);
22561 for val in &self.param_id {
22562 __tmp.put_u8(*val);
22563 }
22564 if matches!(version, MavlinkVersion::V2) {
22565 let len = __tmp.len();
22566 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22567 } else {
22568 __tmp.len()
22569 }
22570 }
22571}
22572#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
22573#[doc = ""]
22574#[doc = "ID: 323"]
22575#[derive(Debug, Clone, PartialEq)]
22576#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22577#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22578pub struct PARAM_EXT_SET_DATA {
22579 #[doc = "System ID"]
22580 pub target_system: u8,
22581 #[doc = "Component ID"]
22582 pub target_component: u8,
22583 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22584 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22585 pub param_id: [u8; 16],
22586 #[doc = "Parameter value"]
22587 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22588 pub param_value: [u8; 128],
22589 #[doc = "Parameter type."]
22590 pub param_type: MavParamExtType,
22591}
22592impl PARAM_EXT_SET_DATA {
22593 pub const ENCODED_LEN: usize = 147usize;
22594 pub const DEFAULT: Self = Self {
22595 target_system: 0_u8,
22596 target_component: 0_u8,
22597 param_id: [0_u8; 16usize],
22598 param_value: [0_u8; 128usize],
22599 param_type: MavParamExtType::DEFAULT,
22600 };
22601 #[cfg(feature = "arbitrary")]
22602 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22603 use arbitrary::{Arbitrary, Unstructured};
22604 let mut buf = [0u8; 1024];
22605 rng.fill_bytes(&mut buf);
22606 let mut unstructured = Unstructured::new(&buf);
22607 Self::arbitrary(&mut unstructured).unwrap_or_default()
22608 }
22609}
22610impl Default for PARAM_EXT_SET_DATA {
22611 fn default() -> Self {
22612 Self::DEFAULT.clone()
22613 }
22614}
22615impl MessageData for PARAM_EXT_SET_DATA {
22616 type Message = MavMessage;
22617 const ID: u32 = 323u32;
22618 const NAME: &'static str = "PARAM_EXT_SET";
22619 const EXTRA_CRC: u8 = 78u8;
22620 const ENCODED_LEN: usize = 147usize;
22621 fn deser(
22622 _version: MavlinkVersion,
22623 __input: &[u8],
22624 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22625 let avail_len = __input.len();
22626 let mut payload_buf = [0; Self::ENCODED_LEN];
22627 let mut buf = if avail_len < Self::ENCODED_LEN {
22628 payload_buf[0..avail_len].copy_from_slice(__input);
22629 Bytes::new(&payload_buf)
22630 } else {
22631 Bytes::new(__input)
22632 };
22633 let mut __struct = Self::default();
22634 __struct.target_system = buf.get_u8();
22635 __struct.target_component = buf.get_u8();
22636 for v in &mut __struct.param_id {
22637 let val = buf.get_u8();
22638 *v = val;
22639 }
22640 for v in &mut __struct.param_value {
22641 let val = buf.get_u8();
22642 *v = val;
22643 }
22644 let tmp = buf.get_u8();
22645 __struct.param_type =
22646 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22647 enum_type: "MavParamExtType",
22648 value: tmp as u32,
22649 })?;
22650 Ok(__struct)
22651 }
22652 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22653 let mut __tmp = BytesMut::new(bytes);
22654 #[allow(clippy::absurd_extreme_comparisons)]
22655 #[allow(unused_comparisons)]
22656 if __tmp.remaining() < Self::ENCODED_LEN {
22657 panic!(
22658 "buffer is too small (need {} bytes, but got {})",
22659 Self::ENCODED_LEN,
22660 __tmp.remaining(),
22661 )
22662 }
22663 __tmp.put_u8(self.target_system);
22664 __tmp.put_u8(self.target_component);
22665 for val in &self.param_id {
22666 __tmp.put_u8(*val);
22667 }
22668 for val in &self.param_value {
22669 __tmp.put_u8(*val);
22670 }
22671 __tmp.put_u8(self.param_type as u8);
22672 if matches!(version, MavlinkVersion::V2) {
22673 let len = __tmp.len();
22674 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22675 } else {
22676 __tmp.len()
22677 }
22678 }
22679}
22680#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
22681#[doc = ""]
22682#[doc = "ID: 322"]
22683#[derive(Debug, Clone, PartialEq)]
22684#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22685#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22686pub struct PARAM_EXT_VALUE_DATA {
22687 #[doc = "Total number of parameters"]
22688 pub param_count: u16,
22689 #[doc = "Index of this parameter"]
22690 pub param_index: u16,
22691 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22692 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22693 pub param_id: [u8; 16],
22694 #[doc = "Parameter value"]
22695 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22696 pub param_value: [u8; 128],
22697 #[doc = "Parameter type."]
22698 pub param_type: MavParamExtType,
22699}
22700impl PARAM_EXT_VALUE_DATA {
22701 pub const ENCODED_LEN: usize = 149usize;
22702 pub const DEFAULT: Self = Self {
22703 param_count: 0_u16,
22704 param_index: 0_u16,
22705 param_id: [0_u8; 16usize],
22706 param_value: [0_u8; 128usize],
22707 param_type: MavParamExtType::DEFAULT,
22708 };
22709 #[cfg(feature = "arbitrary")]
22710 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22711 use arbitrary::{Arbitrary, Unstructured};
22712 let mut buf = [0u8; 1024];
22713 rng.fill_bytes(&mut buf);
22714 let mut unstructured = Unstructured::new(&buf);
22715 Self::arbitrary(&mut unstructured).unwrap_or_default()
22716 }
22717}
22718impl Default for PARAM_EXT_VALUE_DATA {
22719 fn default() -> Self {
22720 Self::DEFAULT.clone()
22721 }
22722}
22723impl MessageData for PARAM_EXT_VALUE_DATA {
22724 type Message = MavMessage;
22725 const ID: u32 = 322u32;
22726 const NAME: &'static str = "PARAM_EXT_VALUE";
22727 const EXTRA_CRC: u8 = 243u8;
22728 const ENCODED_LEN: usize = 149usize;
22729 fn deser(
22730 _version: MavlinkVersion,
22731 __input: &[u8],
22732 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22733 let avail_len = __input.len();
22734 let mut payload_buf = [0; Self::ENCODED_LEN];
22735 let mut buf = if avail_len < Self::ENCODED_LEN {
22736 payload_buf[0..avail_len].copy_from_slice(__input);
22737 Bytes::new(&payload_buf)
22738 } else {
22739 Bytes::new(__input)
22740 };
22741 let mut __struct = Self::default();
22742 __struct.param_count = buf.get_u16_le();
22743 __struct.param_index = buf.get_u16_le();
22744 for v in &mut __struct.param_id {
22745 let val = buf.get_u8();
22746 *v = val;
22747 }
22748 for v in &mut __struct.param_value {
22749 let val = buf.get_u8();
22750 *v = val;
22751 }
22752 let tmp = buf.get_u8();
22753 __struct.param_type =
22754 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22755 enum_type: "MavParamExtType",
22756 value: tmp as u32,
22757 })?;
22758 Ok(__struct)
22759 }
22760 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22761 let mut __tmp = BytesMut::new(bytes);
22762 #[allow(clippy::absurd_extreme_comparisons)]
22763 #[allow(unused_comparisons)]
22764 if __tmp.remaining() < Self::ENCODED_LEN {
22765 panic!(
22766 "buffer is too small (need {} bytes, but got {})",
22767 Self::ENCODED_LEN,
22768 __tmp.remaining(),
22769 )
22770 }
22771 __tmp.put_u16_le(self.param_count);
22772 __tmp.put_u16_le(self.param_index);
22773 for val in &self.param_id {
22774 __tmp.put_u8(*val);
22775 }
22776 for val in &self.param_value {
22777 __tmp.put_u8(*val);
22778 }
22779 __tmp.put_u8(self.param_type as u8);
22780 if matches!(version, MavlinkVersion::V2) {
22781 let len = __tmp.len();
22782 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22783 } else {
22784 __tmp.len()
22785 }
22786 }
22787}
22788#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
22789#[doc = ""]
22790#[doc = "ID: 50"]
22791#[derive(Debug, Clone, PartialEq)]
22792#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22793#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22794pub struct PARAM_MAP_RC_DATA {
22795 #[doc = "Initial parameter value"]
22796 pub param_value0: f32,
22797 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
22798 pub scale: f32,
22799 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
22800 pub param_value_min: f32,
22801 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
22802 pub param_value_max: f32,
22803 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
22804 pub param_index: i16,
22805 #[doc = "System ID"]
22806 pub target_system: u8,
22807 #[doc = "Component ID"]
22808 pub target_component: u8,
22809 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22810 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22811 pub param_id: [u8; 16],
22812 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
22813 pub parameter_rc_channel_index: u8,
22814}
22815impl PARAM_MAP_RC_DATA {
22816 pub const ENCODED_LEN: usize = 37usize;
22817 pub const DEFAULT: Self = Self {
22818 param_value0: 0.0_f32,
22819 scale: 0.0_f32,
22820 param_value_min: 0.0_f32,
22821 param_value_max: 0.0_f32,
22822 param_index: 0_i16,
22823 target_system: 0_u8,
22824 target_component: 0_u8,
22825 param_id: [0_u8; 16usize],
22826 parameter_rc_channel_index: 0_u8,
22827 };
22828 #[cfg(feature = "arbitrary")]
22829 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22830 use arbitrary::{Arbitrary, Unstructured};
22831 let mut buf = [0u8; 1024];
22832 rng.fill_bytes(&mut buf);
22833 let mut unstructured = Unstructured::new(&buf);
22834 Self::arbitrary(&mut unstructured).unwrap_or_default()
22835 }
22836}
22837impl Default for PARAM_MAP_RC_DATA {
22838 fn default() -> Self {
22839 Self::DEFAULT.clone()
22840 }
22841}
22842impl MessageData for PARAM_MAP_RC_DATA {
22843 type Message = MavMessage;
22844 const ID: u32 = 50u32;
22845 const NAME: &'static str = "PARAM_MAP_RC";
22846 const EXTRA_CRC: u8 = 78u8;
22847 const ENCODED_LEN: usize = 37usize;
22848 fn deser(
22849 _version: MavlinkVersion,
22850 __input: &[u8],
22851 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22852 let avail_len = __input.len();
22853 let mut payload_buf = [0; Self::ENCODED_LEN];
22854 let mut buf = if avail_len < Self::ENCODED_LEN {
22855 payload_buf[0..avail_len].copy_from_slice(__input);
22856 Bytes::new(&payload_buf)
22857 } else {
22858 Bytes::new(__input)
22859 };
22860 let mut __struct = Self::default();
22861 __struct.param_value0 = buf.get_f32_le();
22862 __struct.scale = buf.get_f32_le();
22863 __struct.param_value_min = buf.get_f32_le();
22864 __struct.param_value_max = buf.get_f32_le();
22865 __struct.param_index = buf.get_i16_le();
22866 __struct.target_system = buf.get_u8();
22867 __struct.target_component = buf.get_u8();
22868 for v in &mut __struct.param_id {
22869 let val = buf.get_u8();
22870 *v = val;
22871 }
22872 __struct.parameter_rc_channel_index = buf.get_u8();
22873 Ok(__struct)
22874 }
22875 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22876 let mut __tmp = BytesMut::new(bytes);
22877 #[allow(clippy::absurd_extreme_comparisons)]
22878 #[allow(unused_comparisons)]
22879 if __tmp.remaining() < Self::ENCODED_LEN {
22880 panic!(
22881 "buffer is too small (need {} bytes, but got {})",
22882 Self::ENCODED_LEN,
22883 __tmp.remaining(),
22884 )
22885 }
22886 __tmp.put_f32_le(self.param_value0);
22887 __tmp.put_f32_le(self.scale);
22888 __tmp.put_f32_le(self.param_value_min);
22889 __tmp.put_f32_le(self.param_value_max);
22890 __tmp.put_i16_le(self.param_index);
22891 __tmp.put_u8(self.target_system);
22892 __tmp.put_u8(self.target_component);
22893 for val in &self.param_id {
22894 __tmp.put_u8(*val);
22895 }
22896 __tmp.put_u8(self.parameter_rc_channel_index);
22897 if matches!(version, MavlinkVersion::V2) {
22898 let len = __tmp.len();
22899 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22900 } else {
22901 __tmp.len()
22902 }
22903 }
22904}
22905#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
22906#[doc = ""]
22907#[doc = "ID: 21"]
22908#[derive(Debug, Clone, PartialEq)]
22909#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22910#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22911pub struct PARAM_REQUEST_LIST_DATA {
22912 #[doc = "System ID"]
22913 pub target_system: u8,
22914 #[doc = "Component ID"]
22915 pub target_component: u8,
22916}
22917impl PARAM_REQUEST_LIST_DATA {
22918 pub const ENCODED_LEN: usize = 2usize;
22919 pub const DEFAULT: Self = Self {
22920 target_system: 0_u8,
22921 target_component: 0_u8,
22922 };
22923 #[cfg(feature = "arbitrary")]
22924 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22925 use arbitrary::{Arbitrary, Unstructured};
22926 let mut buf = [0u8; 1024];
22927 rng.fill_bytes(&mut buf);
22928 let mut unstructured = Unstructured::new(&buf);
22929 Self::arbitrary(&mut unstructured).unwrap_or_default()
22930 }
22931}
22932impl Default for PARAM_REQUEST_LIST_DATA {
22933 fn default() -> Self {
22934 Self::DEFAULT.clone()
22935 }
22936}
22937impl MessageData for PARAM_REQUEST_LIST_DATA {
22938 type Message = MavMessage;
22939 const ID: u32 = 21u32;
22940 const NAME: &'static str = "PARAM_REQUEST_LIST";
22941 const EXTRA_CRC: u8 = 159u8;
22942 const ENCODED_LEN: usize = 2usize;
22943 fn deser(
22944 _version: MavlinkVersion,
22945 __input: &[u8],
22946 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22947 let avail_len = __input.len();
22948 let mut payload_buf = [0; Self::ENCODED_LEN];
22949 let mut buf = if avail_len < Self::ENCODED_LEN {
22950 payload_buf[0..avail_len].copy_from_slice(__input);
22951 Bytes::new(&payload_buf)
22952 } else {
22953 Bytes::new(__input)
22954 };
22955 let mut __struct = Self::default();
22956 __struct.target_system = buf.get_u8();
22957 __struct.target_component = buf.get_u8();
22958 Ok(__struct)
22959 }
22960 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22961 let mut __tmp = BytesMut::new(bytes);
22962 #[allow(clippy::absurd_extreme_comparisons)]
22963 #[allow(unused_comparisons)]
22964 if __tmp.remaining() < Self::ENCODED_LEN {
22965 panic!(
22966 "buffer is too small (need {} bytes, but got {})",
22967 Self::ENCODED_LEN,
22968 __tmp.remaining(),
22969 )
22970 }
22971 __tmp.put_u8(self.target_system);
22972 __tmp.put_u8(self.target_component);
22973 if matches!(version, MavlinkVersion::V2) {
22974 let len = __tmp.len();
22975 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22976 } else {
22977 __tmp.len()
22978 }
22979 }
22980}
22981#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
22982#[doc = ""]
22983#[doc = "ID: 20"]
22984#[derive(Debug, Clone, PartialEq)]
22985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22986#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22987pub struct PARAM_REQUEST_READ_DATA {
22988 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
22989 pub param_index: i16,
22990 #[doc = "System ID"]
22991 pub target_system: u8,
22992 #[doc = "Component ID"]
22993 pub target_component: u8,
22994 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22995 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22996 pub param_id: [u8; 16],
22997}
22998impl PARAM_REQUEST_READ_DATA {
22999 pub const ENCODED_LEN: usize = 20usize;
23000 pub const DEFAULT: Self = Self {
23001 param_index: 0_i16,
23002 target_system: 0_u8,
23003 target_component: 0_u8,
23004 param_id: [0_u8; 16usize],
23005 };
23006 #[cfg(feature = "arbitrary")]
23007 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23008 use arbitrary::{Arbitrary, Unstructured};
23009 let mut buf = [0u8; 1024];
23010 rng.fill_bytes(&mut buf);
23011 let mut unstructured = Unstructured::new(&buf);
23012 Self::arbitrary(&mut unstructured).unwrap_or_default()
23013 }
23014}
23015impl Default for PARAM_REQUEST_READ_DATA {
23016 fn default() -> Self {
23017 Self::DEFAULT.clone()
23018 }
23019}
23020impl MessageData for PARAM_REQUEST_READ_DATA {
23021 type Message = MavMessage;
23022 const ID: u32 = 20u32;
23023 const NAME: &'static str = "PARAM_REQUEST_READ";
23024 const EXTRA_CRC: u8 = 214u8;
23025 const ENCODED_LEN: usize = 20usize;
23026 fn deser(
23027 _version: MavlinkVersion,
23028 __input: &[u8],
23029 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23030 let avail_len = __input.len();
23031 let mut payload_buf = [0; Self::ENCODED_LEN];
23032 let mut buf = if avail_len < Self::ENCODED_LEN {
23033 payload_buf[0..avail_len].copy_from_slice(__input);
23034 Bytes::new(&payload_buf)
23035 } else {
23036 Bytes::new(__input)
23037 };
23038 let mut __struct = Self::default();
23039 __struct.param_index = buf.get_i16_le();
23040 __struct.target_system = buf.get_u8();
23041 __struct.target_component = buf.get_u8();
23042 for v in &mut __struct.param_id {
23043 let val = buf.get_u8();
23044 *v = val;
23045 }
23046 Ok(__struct)
23047 }
23048 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23049 let mut __tmp = BytesMut::new(bytes);
23050 #[allow(clippy::absurd_extreme_comparisons)]
23051 #[allow(unused_comparisons)]
23052 if __tmp.remaining() < Self::ENCODED_LEN {
23053 panic!(
23054 "buffer is too small (need {} bytes, but got {})",
23055 Self::ENCODED_LEN,
23056 __tmp.remaining(),
23057 )
23058 }
23059 __tmp.put_i16_le(self.param_index);
23060 __tmp.put_u8(self.target_system);
23061 __tmp.put_u8(self.target_component);
23062 for val in &self.param_id {
23063 __tmp.put_u8(*val);
23064 }
23065 if matches!(version, MavlinkVersion::V2) {
23066 let len = __tmp.len();
23067 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23068 } else {
23069 __tmp.len()
23070 }
23071 }
23072}
23073#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23074#[doc = ""]
23075#[doc = "ID: 23"]
23076#[derive(Debug, Clone, PartialEq)]
23077#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23078#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23079pub struct PARAM_SET_DATA {
23080 #[doc = "Onboard parameter value"]
23081 pub param_value: f32,
23082 #[doc = "System ID"]
23083 pub target_system: u8,
23084 #[doc = "Component ID"]
23085 pub target_component: u8,
23086 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23087 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23088 pub param_id: [u8; 16],
23089 #[doc = "Onboard parameter type."]
23090 pub param_type: MavParamType,
23091}
23092impl PARAM_SET_DATA {
23093 pub const ENCODED_LEN: usize = 23usize;
23094 pub const DEFAULT: Self = Self {
23095 param_value: 0.0_f32,
23096 target_system: 0_u8,
23097 target_component: 0_u8,
23098 param_id: [0_u8; 16usize],
23099 param_type: MavParamType::DEFAULT,
23100 };
23101 #[cfg(feature = "arbitrary")]
23102 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23103 use arbitrary::{Arbitrary, Unstructured};
23104 let mut buf = [0u8; 1024];
23105 rng.fill_bytes(&mut buf);
23106 let mut unstructured = Unstructured::new(&buf);
23107 Self::arbitrary(&mut unstructured).unwrap_or_default()
23108 }
23109}
23110impl Default for PARAM_SET_DATA {
23111 fn default() -> Self {
23112 Self::DEFAULT.clone()
23113 }
23114}
23115impl MessageData for PARAM_SET_DATA {
23116 type Message = MavMessage;
23117 const ID: u32 = 23u32;
23118 const NAME: &'static str = "PARAM_SET";
23119 const EXTRA_CRC: u8 = 168u8;
23120 const ENCODED_LEN: usize = 23usize;
23121 fn deser(
23122 _version: MavlinkVersion,
23123 __input: &[u8],
23124 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23125 let avail_len = __input.len();
23126 let mut payload_buf = [0; Self::ENCODED_LEN];
23127 let mut buf = if avail_len < Self::ENCODED_LEN {
23128 payload_buf[0..avail_len].copy_from_slice(__input);
23129 Bytes::new(&payload_buf)
23130 } else {
23131 Bytes::new(__input)
23132 };
23133 let mut __struct = Self::default();
23134 __struct.param_value = buf.get_f32_le();
23135 __struct.target_system = buf.get_u8();
23136 __struct.target_component = buf.get_u8();
23137 for v in &mut __struct.param_id {
23138 let val = buf.get_u8();
23139 *v = val;
23140 }
23141 let tmp = buf.get_u8();
23142 __struct.param_type =
23143 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23144 enum_type: "MavParamType",
23145 value: tmp as u32,
23146 })?;
23147 Ok(__struct)
23148 }
23149 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23150 let mut __tmp = BytesMut::new(bytes);
23151 #[allow(clippy::absurd_extreme_comparisons)]
23152 #[allow(unused_comparisons)]
23153 if __tmp.remaining() < Self::ENCODED_LEN {
23154 panic!(
23155 "buffer is too small (need {} bytes, but got {})",
23156 Self::ENCODED_LEN,
23157 __tmp.remaining(),
23158 )
23159 }
23160 __tmp.put_f32_le(self.param_value);
23161 __tmp.put_u8(self.target_system);
23162 __tmp.put_u8(self.target_component);
23163 for val in &self.param_id {
23164 __tmp.put_u8(*val);
23165 }
23166 __tmp.put_u8(self.param_type as u8);
23167 if matches!(version, MavlinkVersion::V2) {
23168 let len = __tmp.len();
23169 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23170 } else {
23171 __tmp.len()
23172 }
23173 }
23174}
23175#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23176#[doc = ""]
23177#[doc = "ID: 22"]
23178#[derive(Debug, Clone, PartialEq)]
23179#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23180#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23181pub struct PARAM_VALUE_DATA {
23182 #[doc = "Onboard parameter value"]
23183 pub param_value: f32,
23184 #[doc = "Total number of onboard parameters"]
23185 pub param_count: u16,
23186 #[doc = "Index of this onboard parameter"]
23187 pub param_index: u16,
23188 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23189 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23190 pub param_id: [u8; 16],
23191 #[doc = "Onboard parameter type."]
23192 pub param_type: MavParamType,
23193}
23194impl PARAM_VALUE_DATA {
23195 pub const ENCODED_LEN: usize = 25usize;
23196 pub const DEFAULT: Self = Self {
23197 param_value: 0.0_f32,
23198 param_count: 0_u16,
23199 param_index: 0_u16,
23200 param_id: [0_u8; 16usize],
23201 param_type: MavParamType::DEFAULT,
23202 };
23203 #[cfg(feature = "arbitrary")]
23204 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23205 use arbitrary::{Arbitrary, Unstructured};
23206 let mut buf = [0u8; 1024];
23207 rng.fill_bytes(&mut buf);
23208 let mut unstructured = Unstructured::new(&buf);
23209 Self::arbitrary(&mut unstructured).unwrap_or_default()
23210 }
23211}
23212impl Default for PARAM_VALUE_DATA {
23213 fn default() -> Self {
23214 Self::DEFAULT.clone()
23215 }
23216}
23217impl MessageData for PARAM_VALUE_DATA {
23218 type Message = MavMessage;
23219 const ID: u32 = 22u32;
23220 const NAME: &'static str = "PARAM_VALUE";
23221 const EXTRA_CRC: u8 = 220u8;
23222 const ENCODED_LEN: usize = 25usize;
23223 fn deser(
23224 _version: MavlinkVersion,
23225 __input: &[u8],
23226 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23227 let avail_len = __input.len();
23228 let mut payload_buf = [0; Self::ENCODED_LEN];
23229 let mut buf = if avail_len < Self::ENCODED_LEN {
23230 payload_buf[0..avail_len].copy_from_slice(__input);
23231 Bytes::new(&payload_buf)
23232 } else {
23233 Bytes::new(__input)
23234 };
23235 let mut __struct = Self::default();
23236 __struct.param_value = buf.get_f32_le();
23237 __struct.param_count = buf.get_u16_le();
23238 __struct.param_index = buf.get_u16_le();
23239 for v in &mut __struct.param_id {
23240 let val = buf.get_u8();
23241 *v = val;
23242 }
23243 let tmp = buf.get_u8();
23244 __struct.param_type =
23245 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23246 enum_type: "MavParamType",
23247 value: tmp as u32,
23248 })?;
23249 Ok(__struct)
23250 }
23251 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23252 let mut __tmp = BytesMut::new(bytes);
23253 #[allow(clippy::absurd_extreme_comparisons)]
23254 #[allow(unused_comparisons)]
23255 if __tmp.remaining() < Self::ENCODED_LEN {
23256 panic!(
23257 "buffer is too small (need {} bytes, but got {})",
23258 Self::ENCODED_LEN,
23259 __tmp.remaining(),
23260 )
23261 }
23262 __tmp.put_f32_le(self.param_value);
23263 __tmp.put_u16_le(self.param_count);
23264 __tmp.put_u16_le(self.param_index);
23265 for val in &self.param_id {
23266 __tmp.put_u8(*val);
23267 }
23268 __tmp.put_u8(self.param_type as u8);
23269 if matches!(version, MavlinkVersion::V2) {
23270 let len = __tmp.len();
23271 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23272 } else {
23273 __tmp.len()
23274 }
23275 }
23276}
23277#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
23278#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
23279#[doc = ""]
23280#[doc = "ID: 4"]
23281#[derive(Debug, Clone, PartialEq)]
23282#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23283#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23284pub struct PING_DATA {
23285 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23286 pub time_usec: u64,
23287 #[doc = "PING sequence"]
23288 pub seq: u32,
23289 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
23290 pub target_system: u8,
23291 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
23292 pub target_component: u8,
23293}
23294impl PING_DATA {
23295 pub const ENCODED_LEN: usize = 14usize;
23296 pub const DEFAULT: Self = Self {
23297 time_usec: 0_u64,
23298 seq: 0_u32,
23299 target_system: 0_u8,
23300 target_component: 0_u8,
23301 };
23302 #[cfg(feature = "arbitrary")]
23303 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23304 use arbitrary::{Arbitrary, Unstructured};
23305 let mut buf = [0u8; 1024];
23306 rng.fill_bytes(&mut buf);
23307 let mut unstructured = Unstructured::new(&buf);
23308 Self::arbitrary(&mut unstructured).unwrap_or_default()
23309 }
23310}
23311impl Default for PING_DATA {
23312 fn default() -> Self {
23313 Self::DEFAULT.clone()
23314 }
23315}
23316impl MessageData for PING_DATA {
23317 type Message = MavMessage;
23318 const ID: u32 = 4u32;
23319 const NAME: &'static str = "PING";
23320 const EXTRA_CRC: u8 = 237u8;
23321 const ENCODED_LEN: usize = 14usize;
23322 fn deser(
23323 _version: MavlinkVersion,
23324 __input: &[u8],
23325 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23326 let avail_len = __input.len();
23327 let mut payload_buf = [0; Self::ENCODED_LEN];
23328 let mut buf = if avail_len < Self::ENCODED_LEN {
23329 payload_buf[0..avail_len].copy_from_slice(__input);
23330 Bytes::new(&payload_buf)
23331 } else {
23332 Bytes::new(__input)
23333 };
23334 let mut __struct = Self::default();
23335 __struct.time_usec = buf.get_u64_le();
23336 __struct.seq = buf.get_u32_le();
23337 __struct.target_system = buf.get_u8();
23338 __struct.target_component = buf.get_u8();
23339 Ok(__struct)
23340 }
23341 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23342 let mut __tmp = BytesMut::new(bytes);
23343 #[allow(clippy::absurd_extreme_comparisons)]
23344 #[allow(unused_comparisons)]
23345 if __tmp.remaining() < Self::ENCODED_LEN {
23346 panic!(
23347 "buffer is too small (need {} bytes, but got {})",
23348 Self::ENCODED_LEN,
23349 __tmp.remaining(),
23350 )
23351 }
23352 __tmp.put_u64_le(self.time_usec);
23353 __tmp.put_u32_le(self.seq);
23354 __tmp.put_u8(self.target_system);
23355 __tmp.put_u8(self.target_component);
23356 if matches!(version, MavlinkVersion::V2) {
23357 let len = __tmp.len();
23358 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23359 } else {
23360 __tmp.len()
23361 }
23362 }
23363}
23364#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
23365#[doc = "Control vehicle tone generation (buzzer)."]
23366#[doc = ""]
23367#[doc = "ID: 258"]
23368#[derive(Debug, Clone, PartialEq)]
23369#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23370#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23371pub struct PLAY_TUNE_DATA {
23372 #[doc = "System ID"]
23373 pub target_system: u8,
23374 #[doc = "Component ID"]
23375 pub target_component: u8,
23376 #[doc = "tune in board specific format"]
23377 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23378 pub tune: [u8; 30],
23379 #[doc = "tune extension (appended to tune)"]
23380 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23381 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23382 pub tune2: [u8; 200],
23383}
23384impl PLAY_TUNE_DATA {
23385 pub const ENCODED_LEN: usize = 232usize;
23386 pub const DEFAULT: Self = Self {
23387 target_system: 0_u8,
23388 target_component: 0_u8,
23389 tune: [0_u8; 30usize],
23390 tune2: [0_u8; 200usize],
23391 };
23392 #[cfg(feature = "arbitrary")]
23393 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23394 use arbitrary::{Arbitrary, Unstructured};
23395 let mut buf = [0u8; 1024];
23396 rng.fill_bytes(&mut buf);
23397 let mut unstructured = Unstructured::new(&buf);
23398 Self::arbitrary(&mut unstructured).unwrap_or_default()
23399 }
23400}
23401impl Default for PLAY_TUNE_DATA {
23402 fn default() -> Self {
23403 Self::DEFAULT.clone()
23404 }
23405}
23406impl MessageData for PLAY_TUNE_DATA {
23407 type Message = MavMessage;
23408 const ID: u32 = 258u32;
23409 const NAME: &'static str = "PLAY_TUNE";
23410 const EXTRA_CRC: u8 = 187u8;
23411 const ENCODED_LEN: usize = 232usize;
23412 fn deser(
23413 _version: MavlinkVersion,
23414 __input: &[u8],
23415 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23416 let avail_len = __input.len();
23417 let mut payload_buf = [0; Self::ENCODED_LEN];
23418 let mut buf = if avail_len < Self::ENCODED_LEN {
23419 payload_buf[0..avail_len].copy_from_slice(__input);
23420 Bytes::new(&payload_buf)
23421 } else {
23422 Bytes::new(__input)
23423 };
23424 let mut __struct = Self::default();
23425 __struct.target_system = buf.get_u8();
23426 __struct.target_component = buf.get_u8();
23427 for v in &mut __struct.tune {
23428 let val = buf.get_u8();
23429 *v = val;
23430 }
23431 for v in &mut __struct.tune2 {
23432 let val = buf.get_u8();
23433 *v = val;
23434 }
23435 Ok(__struct)
23436 }
23437 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23438 let mut __tmp = BytesMut::new(bytes);
23439 #[allow(clippy::absurd_extreme_comparisons)]
23440 #[allow(unused_comparisons)]
23441 if __tmp.remaining() < Self::ENCODED_LEN {
23442 panic!(
23443 "buffer is too small (need {} bytes, but got {})",
23444 Self::ENCODED_LEN,
23445 __tmp.remaining(),
23446 )
23447 }
23448 __tmp.put_u8(self.target_system);
23449 __tmp.put_u8(self.target_component);
23450 for val in &self.tune {
23451 __tmp.put_u8(*val);
23452 }
23453 if matches!(version, MavlinkVersion::V2) {
23454 for val in &self.tune2 {
23455 __tmp.put_u8(*val);
23456 }
23457 let len = __tmp.len();
23458 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23459 } else {
23460 __tmp.len()
23461 }
23462 }
23463}
23464#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
23465#[doc = ""]
23466#[doc = "ID: 400"]
23467#[derive(Debug, Clone, PartialEq)]
23468#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23469#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23470pub struct PLAY_TUNE_V2_DATA {
23471 #[doc = "Tune format"]
23472 pub format: TuneFormat,
23473 #[doc = "System ID"]
23474 pub target_system: u8,
23475 #[doc = "Component ID"]
23476 pub target_component: u8,
23477 #[doc = "Tune definition as a NULL-terminated string."]
23478 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23479 pub tune: [u8; 248],
23480}
23481impl PLAY_TUNE_V2_DATA {
23482 pub const ENCODED_LEN: usize = 254usize;
23483 pub const DEFAULT: Self = Self {
23484 format: TuneFormat::DEFAULT,
23485 target_system: 0_u8,
23486 target_component: 0_u8,
23487 tune: [0_u8; 248usize],
23488 };
23489 #[cfg(feature = "arbitrary")]
23490 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23491 use arbitrary::{Arbitrary, Unstructured};
23492 let mut buf = [0u8; 1024];
23493 rng.fill_bytes(&mut buf);
23494 let mut unstructured = Unstructured::new(&buf);
23495 Self::arbitrary(&mut unstructured).unwrap_or_default()
23496 }
23497}
23498impl Default for PLAY_TUNE_V2_DATA {
23499 fn default() -> Self {
23500 Self::DEFAULT.clone()
23501 }
23502}
23503impl MessageData for PLAY_TUNE_V2_DATA {
23504 type Message = MavMessage;
23505 const ID: u32 = 400u32;
23506 const NAME: &'static str = "PLAY_TUNE_V2";
23507 const EXTRA_CRC: u8 = 110u8;
23508 const ENCODED_LEN: usize = 254usize;
23509 fn deser(
23510 _version: MavlinkVersion,
23511 __input: &[u8],
23512 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23513 let avail_len = __input.len();
23514 let mut payload_buf = [0; Self::ENCODED_LEN];
23515 let mut buf = if avail_len < Self::ENCODED_LEN {
23516 payload_buf[0..avail_len].copy_from_slice(__input);
23517 Bytes::new(&payload_buf)
23518 } else {
23519 Bytes::new(__input)
23520 };
23521 let mut __struct = Self::default();
23522 let tmp = buf.get_u32_le();
23523 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
23524 ::mavlink_core::error::ParserError::InvalidEnum {
23525 enum_type: "TuneFormat",
23526 value: tmp as u32,
23527 },
23528 )?;
23529 __struct.target_system = buf.get_u8();
23530 __struct.target_component = buf.get_u8();
23531 for v in &mut __struct.tune {
23532 let val = buf.get_u8();
23533 *v = val;
23534 }
23535 Ok(__struct)
23536 }
23537 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23538 let mut __tmp = BytesMut::new(bytes);
23539 #[allow(clippy::absurd_extreme_comparisons)]
23540 #[allow(unused_comparisons)]
23541 if __tmp.remaining() < Self::ENCODED_LEN {
23542 panic!(
23543 "buffer is too small (need {} bytes, but got {})",
23544 Self::ENCODED_LEN,
23545 __tmp.remaining(),
23546 )
23547 }
23548 __tmp.put_u32_le(self.format as u32);
23549 __tmp.put_u8(self.target_system);
23550 __tmp.put_u8(self.target_component);
23551 for val in &self.tune {
23552 __tmp.put_u8(*val);
23553 }
23554 if matches!(version, MavlinkVersion::V2) {
23555 let len = __tmp.len();
23556 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23557 } else {
23558 __tmp.len()
23559 }
23560 }
23561}
23562#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
23563#[doc = ""]
23564#[doc = "ID: 87"]
23565#[derive(Debug, Clone, PartialEq)]
23566#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23567#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23568pub struct POSITION_TARGET_GLOBAL_INT_DATA {
23569 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
23570 pub time_boot_ms: u32,
23571 #[doc = "Latitude in WGS84 frame"]
23572 pub lat_int: i32,
23573 #[doc = "Longitude in WGS84 frame"]
23574 pub lon_int: i32,
23575 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
23576 pub alt: f32,
23577 #[doc = "X velocity in NED frame"]
23578 pub vx: f32,
23579 #[doc = "Y velocity in NED frame"]
23580 pub vy: f32,
23581 #[doc = "Z velocity in NED frame"]
23582 pub vz: f32,
23583 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23584 pub afx: f32,
23585 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23586 pub afy: f32,
23587 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23588 pub afz: f32,
23589 #[doc = "yaw setpoint"]
23590 pub yaw: f32,
23591 #[doc = "yaw rate setpoint"]
23592 pub yaw_rate: f32,
23593 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
23594 pub type_mask: PositionTargetTypemask,
23595 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
23596 pub coordinate_frame: MavFrame,
23597}
23598impl POSITION_TARGET_GLOBAL_INT_DATA {
23599 pub const ENCODED_LEN: usize = 51usize;
23600 pub const DEFAULT: Self = Self {
23601 time_boot_ms: 0_u32,
23602 lat_int: 0_i32,
23603 lon_int: 0_i32,
23604 alt: 0.0_f32,
23605 vx: 0.0_f32,
23606 vy: 0.0_f32,
23607 vz: 0.0_f32,
23608 afx: 0.0_f32,
23609 afy: 0.0_f32,
23610 afz: 0.0_f32,
23611 yaw: 0.0_f32,
23612 yaw_rate: 0.0_f32,
23613 type_mask: PositionTargetTypemask::DEFAULT,
23614 coordinate_frame: MavFrame::DEFAULT,
23615 };
23616 #[cfg(feature = "arbitrary")]
23617 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23618 use arbitrary::{Arbitrary, Unstructured};
23619 let mut buf = [0u8; 1024];
23620 rng.fill_bytes(&mut buf);
23621 let mut unstructured = Unstructured::new(&buf);
23622 Self::arbitrary(&mut unstructured).unwrap_or_default()
23623 }
23624}
23625impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
23626 fn default() -> Self {
23627 Self::DEFAULT.clone()
23628 }
23629}
23630impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
23631 type Message = MavMessage;
23632 const ID: u32 = 87u32;
23633 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
23634 const EXTRA_CRC: u8 = 150u8;
23635 const ENCODED_LEN: usize = 51usize;
23636 fn deser(
23637 _version: MavlinkVersion,
23638 __input: &[u8],
23639 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23640 let avail_len = __input.len();
23641 let mut payload_buf = [0; Self::ENCODED_LEN];
23642 let mut buf = if avail_len < Self::ENCODED_LEN {
23643 payload_buf[0..avail_len].copy_from_slice(__input);
23644 Bytes::new(&payload_buf)
23645 } else {
23646 Bytes::new(__input)
23647 };
23648 let mut __struct = Self::default();
23649 __struct.time_boot_ms = buf.get_u32_le();
23650 __struct.lat_int = buf.get_i32_le();
23651 __struct.lon_int = buf.get_i32_le();
23652 __struct.alt = buf.get_f32_le();
23653 __struct.vx = buf.get_f32_le();
23654 __struct.vy = buf.get_f32_le();
23655 __struct.vz = buf.get_f32_le();
23656 __struct.afx = buf.get_f32_le();
23657 __struct.afy = buf.get_f32_le();
23658 __struct.afz = buf.get_f32_le();
23659 __struct.yaw = buf.get_f32_le();
23660 __struct.yaw_rate = buf.get_f32_le();
23661 let tmp = buf.get_u16_le();
23662 __struct.type_mask = PositionTargetTypemask::from_bits(
23663 tmp & PositionTargetTypemask::all().bits(),
23664 )
23665 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23666 flag_type: "PositionTargetTypemask",
23667 value: tmp as u32,
23668 })?;
23669 let tmp = buf.get_u8();
23670 __struct.coordinate_frame =
23671 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23672 enum_type: "MavFrame",
23673 value: tmp as u32,
23674 })?;
23675 Ok(__struct)
23676 }
23677 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23678 let mut __tmp = BytesMut::new(bytes);
23679 #[allow(clippy::absurd_extreme_comparisons)]
23680 #[allow(unused_comparisons)]
23681 if __tmp.remaining() < Self::ENCODED_LEN {
23682 panic!(
23683 "buffer is too small (need {} bytes, but got {})",
23684 Self::ENCODED_LEN,
23685 __tmp.remaining(),
23686 )
23687 }
23688 __tmp.put_u32_le(self.time_boot_ms);
23689 __tmp.put_i32_le(self.lat_int);
23690 __tmp.put_i32_le(self.lon_int);
23691 __tmp.put_f32_le(self.alt);
23692 __tmp.put_f32_le(self.vx);
23693 __tmp.put_f32_le(self.vy);
23694 __tmp.put_f32_le(self.vz);
23695 __tmp.put_f32_le(self.afx);
23696 __tmp.put_f32_le(self.afy);
23697 __tmp.put_f32_le(self.afz);
23698 __tmp.put_f32_le(self.yaw);
23699 __tmp.put_f32_le(self.yaw_rate);
23700 __tmp.put_u16_le(self.type_mask.bits());
23701 __tmp.put_u8(self.coordinate_frame as u8);
23702 if matches!(version, MavlinkVersion::V2) {
23703 let len = __tmp.len();
23704 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23705 } else {
23706 __tmp.len()
23707 }
23708 }
23709}
23710#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
23711#[doc = ""]
23712#[doc = "ID: 85"]
23713#[derive(Debug, Clone, PartialEq)]
23714#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23715#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23716pub struct POSITION_TARGET_LOCAL_NED_DATA {
23717 #[doc = "Timestamp (time since system boot)."]
23718 pub time_boot_ms: u32,
23719 #[doc = "X Position in NED frame"]
23720 pub x: f32,
23721 #[doc = "Y Position in NED frame"]
23722 pub y: f32,
23723 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
23724 pub z: f32,
23725 #[doc = "X velocity in NED frame"]
23726 pub vx: f32,
23727 #[doc = "Y velocity in NED frame"]
23728 pub vy: f32,
23729 #[doc = "Z velocity in NED frame"]
23730 pub vz: f32,
23731 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23732 pub afx: f32,
23733 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23734 pub afy: f32,
23735 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23736 pub afz: f32,
23737 #[doc = "yaw setpoint"]
23738 pub yaw: f32,
23739 #[doc = "yaw rate setpoint"]
23740 pub yaw_rate: f32,
23741 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
23742 pub type_mask: PositionTargetTypemask,
23743 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
23744 pub coordinate_frame: MavFrame,
23745}
23746impl POSITION_TARGET_LOCAL_NED_DATA {
23747 pub const ENCODED_LEN: usize = 51usize;
23748 pub const DEFAULT: Self = Self {
23749 time_boot_ms: 0_u32,
23750 x: 0.0_f32,
23751 y: 0.0_f32,
23752 z: 0.0_f32,
23753 vx: 0.0_f32,
23754 vy: 0.0_f32,
23755 vz: 0.0_f32,
23756 afx: 0.0_f32,
23757 afy: 0.0_f32,
23758 afz: 0.0_f32,
23759 yaw: 0.0_f32,
23760 yaw_rate: 0.0_f32,
23761 type_mask: PositionTargetTypemask::DEFAULT,
23762 coordinate_frame: MavFrame::DEFAULT,
23763 };
23764 #[cfg(feature = "arbitrary")]
23765 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23766 use arbitrary::{Arbitrary, Unstructured};
23767 let mut buf = [0u8; 1024];
23768 rng.fill_bytes(&mut buf);
23769 let mut unstructured = Unstructured::new(&buf);
23770 Self::arbitrary(&mut unstructured).unwrap_or_default()
23771 }
23772}
23773impl Default for POSITION_TARGET_LOCAL_NED_DATA {
23774 fn default() -> Self {
23775 Self::DEFAULT.clone()
23776 }
23777}
23778impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
23779 type Message = MavMessage;
23780 const ID: u32 = 85u32;
23781 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
23782 const EXTRA_CRC: u8 = 140u8;
23783 const ENCODED_LEN: usize = 51usize;
23784 fn deser(
23785 _version: MavlinkVersion,
23786 __input: &[u8],
23787 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23788 let avail_len = __input.len();
23789 let mut payload_buf = [0; Self::ENCODED_LEN];
23790 let mut buf = if avail_len < Self::ENCODED_LEN {
23791 payload_buf[0..avail_len].copy_from_slice(__input);
23792 Bytes::new(&payload_buf)
23793 } else {
23794 Bytes::new(__input)
23795 };
23796 let mut __struct = Self::default();
23797 __struct.time_boot_ms = buf.get_u32_le();
23798 __struct.x = buf.get_f32_le();
23799 __struct.y = buf.get_f32_le();
23800 __struct.z = buf.get_f32_le();
23801 __struct.vx = buf.get_f32_le();
23802 __struct.vy = buf.get_f32_le();
23803 __struct.vz = buf.get_f32_le();
23804 __struct.afx = buf.get_f32_le();
23805 __struct.afy = buf.get_f32_le();
23806 __struct.afz = buf.get_f32_le();
23807 __struct.yaw = buf.get_f32_le();
23808 __struct.yaw_rate = buf.get_f32_le();
23809 let tmp = buf.get_u16_le();
23810 __struct.type_mask = PositionTargetTypemask::from_bits(
23811 tmp & PositionTargetTypemask::all().bits(),
23812 )
23813 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23814 flag_type: "PositionTargetTypemask",
23815 value: tmp as u32,
23816 })?;
23817 let tmp = buf.get_u8();
23818 __struct.coordinate_frame =
23819 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23820 enum_type: "MavFrame",
23821 value: tmp as u32,
23822 })?;
23823 Ok(__struct)
23824 }
23825 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23826 let mut __tmp = BytesMut::new(bytes);
23827 #[allow(clippy::absurd_extreme_comparisons)]
23828 #[allow(unused_comparisons)]
23829 if __tmp.remaining() < Self::ENCODED_LEN {
23830 panic!(
23831 "buffer is too small (need {} bytes, but got {})",
23832 Self::ENCODED_LEN,
23833 __tmp.remaining(),
23834 )
23835 }
23836 __tmp.put_u32_le(self.time_boot_ms);
23837 __tmp.put_f32_le(self.x);
23838 __tmp.put_f32_le(self.y);
23839 __tmp.put_f32_le(self.z);
23840 __tmp.put_f32_le(self.vx);
23841 __tmp.put_f32_le(self.vy);
23842 __tmp.put_f32_le(self.vz);
23843 __tmp.put_f32_le(self.afx);
23844 __tmp.put_f32_le(self.afy);
23845 __tmp.put_f32_le(self.afz);
23846 __tmp.put_f32_le(self.yaw);
23847 __tmp.put_f32_le(self.yaw_rate);
23848 __tmp.put_u16_le(self.type_mask.bits());
23849 __tmp.put_u8(self.coordinate_frame as u8);
23850 if matches!(version, MavlinkVersion::V2) {
23851 let len = __tmp.len();
23852 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23853 } else {
23854 __tmp.len()
23855 }
23856 }
23857}
23858#[doc = "Power supply status."]
23859#[doc = ""]
23860#[doc = "ID: 125"]
23861#[derive(Debug, Clone, PartialEq)]
23862#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23863#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23864pub struct POWER_STATUS_DATA {
23865 #[doc = "5V rail voltage."]
23866 pub Vcc: u16,
23867 #[doc = "Servo rail voltage."]
23868 pub Vservo: u16,
23869 #[doc = "Bitmap of power supply status flags."]
23870 pub flags: MavPowerStatus,
23871}
23872impl POWER_STATUS_DATA {
23873 pub const ENCODED_LEN: usize = 6usize;
23874 pub const DEFAULT: Self = Self {
23875 Vcc: 0_u16,
23876 Vservo: 0_u16,
23877 flags: MavPowerStatus::DEFAULT,
23878 };
23879 #[cfg(feature = "arbitrary")]
23880 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23881 use arbitrary::{Arbitrary, Unstructured};
23882 let mut buf = [0u8; 1024];
23883 rng.fill_bytes(&mut buf);
23884 let mut unstructured = Unstructured::new(&buf);
23885 Self::arbitrary(&mut unstructured).unwrap_or_default()
23886 }
23887}
23888impl Default for POWER_STATUS_DATA {
23889 fn default() -> Self {
23890 Self::DEFAULT.clone()
23891 }
23892}
23893impl MessageData for POWER_STATUS_DATA {
23894 type Message = MavMessage;
23895 const ID: u32 = 125u32;
23896 const NAME: &'static str = "POWER_STATUS";
23897 const EXTRA_CRC: u8 = 203u8;
23898 const ENCODED_LEN: usize = 6usize;
23899 fn deser(
23900 _version: MavlinkVersion,
23901 __input: &[u8],
23902 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23903 let avail_len = __input.len();
23904 let mut payload_buf = [0; Self::ENCODED_LEN];
23905 let mut buf = if avail_len < Self::ENCODED_LEN {
23906 payload_buf[0..avail_len].copy_from_slice(__input);
23907 Bytes::new(&payload_buf)
23908 } else {
23909 Bytes::new(__input)
23910 };
23911 let mut __struct = Self::default();
23912 __struct.Vcc = buf.get_u16_le();
23913 __struct.Vservo = buf.get_u16_le();
23914 let tmp = buf.get_u16_le();
23915 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
23916 ::mavlink_core::error::ParserError::InvalidFlag {
23917 flag_type: "MavPowerStatus",
23918 value: tmp as u32,
23919 },
23920 )?;
23921 Ok(__struct)
23922 }
23923 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23924 let mut __tmp = BytesMut::new(bytes);
23925 #[allow(clippy::absurd_extreme_comparisons)]
23926 #[allow(unused_comparisons)]
23927 if __tmp.remaining() < Self::ENCODED_LEN {
23928 panic!(
23929 "buffer is too small (need {} bytes, but got {})",
23930 Self::ENCODED_LEN,
23931 __tmp.remaining(),
23932 )
23933 }
23934 __tmp.put_u16_le(self.Vcc);
23935 __tmp.put_u16_le(self.Vservo);
23936 __tmp.put_u16_le(self.flags.bits());
23937 if matches!(version, MavlinkVersion::V2) {
23938 let len = __tmp.len();
23939 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23940 } else {
23941 __tmp.len()
23942 }
23943 }
23944}
23945#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
23946#[doc = ""]
23947#[doc = "ID: 300"]
23948#[derive(Debug, Clone, PartialEq)]
23949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23950#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23951pub struct PROTOCOL_VERSION_DATA {
23952 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
23953 pub version: u16,
23954 #[doc = "Minimum MAVLink version supported"]
23955 pub min_version: u16,
23956 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
23957 pub max_version: u16,
23958 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
23959 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23960 pub spec_version_hash: [u8; 8],
23961 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
23962 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23963 pub library_version_hash: [u8; 8],
23964}
23965impl PROTOCOL_VERSION_DATA {
23966 pub const ENCODED_LEN: usize = 22usize;
23967 pub const DEFAULT: Self = Self {
23968 version: 0_u16,
23969 min_version: 0_u16,
23970 max_version: 0_u16,
23971 spec_version_hash: [0_u8; 8usize],
23972 library_version_hash: [0_u8; 8usize],
23973 };
23974 #[cfg(feature = "arbitrary")]
23975 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23976 use arbitrary::{Arbitrary, Unstructured};
23977 let mut buf = [0u8; 1024];
23978 rng.fill_bytes(&mut buf);
23979 let mut unstructured = Unstructured::new(&buf);
23980 Self::arbitrary(&mut unstructured).unwrap_or_default()
23981 }
23982}
23983impl Default for PROTOCOL_VERSION_DATA {
23984 fn default() -> Self {
23985 Self::DEFAULT.clone()
23986 }
23987}
23988impl MessageData for PROTOCOL_VERSION_DATA {
23989 type Message = MavMessage;
23990 const ID: u32 = 300u32;
23991 const NAME: &'static str = "PROTOCOL_VERSION";
23992 const EXTRA_CRC: u8 = 217u8;
23993 const ENCODED_LEN: usize = 22usize;
23994 fn deser(
23995 _version: MavlinkVersion,
23996 __input: &[u8],
23997 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23998 let avail_len = __input.len();
23999 let mut payload_buf = [0; Self::ENCODED_LEN];
24000 let mut buf = if avail_len < Self::ENCODED_LEN {
24001 payload_buf[0..avail_len].copy_from_slice(__input);
24002 Bytes::new(&payload_buf)
24003 } else {
24004 Bytes::new(__input)
24005 };
24006 let mut __struct = Self::default();
24007 __struct.version = buf.get_u16_le();
24008 __struct.min_version = buf.get_u16_le();
24009 __struct.max_version = buf.get_u16_le();
24010 for v in &mut __struct.spec_version_hash {
24011 let val = buf.get_u8();
24012 *v = val;
24013 }
24014 for v in &mut __struct.library_version_hash {
24015 let val = buf.get_u8();
24016 *v = val;
24017 }
24018 Ok(__struct)
24019 }
24020 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24021 let mut __tmp = BytesMut::new(bytes);
24022 #[allow(clippy::absurd_extreme_comparisons)]
24023 #[allow(unused_comparisons)]
24024 if __tmp.remaining() < Self::ENCODED_LEN {
24025 panic!(
24026 "buffer is too small (need {} bytes, but got {})",
24027 Self::ENCODED_LEN,
24028 __tmp.remaining(),
24029 )
24030 }
24031 __tmp.put_u16_le(self.version);
24032 __tmp.put_u16_le(self.min_version);
24033 __tmp.put_u16_le(self.max_version);
24034 for val in &self.spec_version_hash {
24035 __tmp.put_u8(*val);
24036 }
24037 for val in &self.library_version_hash {
24038 __tmp.put_u8(*val);
24039 }
24040 if matches!(version, MavlinkVersion::V2) {
24041 let len = __tmp.len();
24042 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24043 } else {
24044 __tmp.len()
24045 }
24046 }
24047}
24048#[doc = "Status generated by radio and injected into MAVLink stream."]
24049#[doc = ""]
24050#[doc = "ID: 109"]
24051#[derive(Debug, Clone, PartialEq)]
24052#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24053#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24054pub struct RADIO_STATUS_DATA {
24055 #[doc = "Count of radio packet receive errors (since boot)."]
24056 pub rxerrors: u16,
24057 #[doc = "Count of error corrected radio packets (since boot)."]
24058 pub fixed: u16,
24059 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24060 pub rssi: u8,
24061 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24062 pub remrssi: u8,
24063 #[doc = "Remaining free transmitter buffer space."]
24064 pub txbuf: u8,
24065 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24066 pub noise: u8,
24067 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24068 pub remnoise: u8,
24069}
24070impl RADIO_STATUS_DATA {
24071 pub const ENCODED_LEN: usize = 9usize;
24072 pub const DEFAULT: Self = Self {
24073 rxerrors: 0_u16,
24074 fixed: 0_u16,
24075 rssi: 0_u8,
24076 remrssi: 0_u8,
24077 txbuf: 0_u8,
24078 noise: 0_u8,
24079 remnoise: 0_u8,
24080 };
24081 #[cfg(feature = "arbitrary")]
24082 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24083 use arbitrary::{Arbitrary, Unstructured};
24084 let mut buf = [0u8; 1024];
24085 rng.fill_bytes(&mut buf);
24086 let mut unstructured = Unstructured::new(&buf);
24087 Self::arbitrary(&mut unstructured).unwrap_or_default()
24088 }
24089}
24090impl Default for RADIO_STATUS_DATA {
24091 fn default() -> Self {
24092 Self::DEFAULT.clone()
24093 }
24094}
24095impl MessageData for RADIO_STATUS_DATA {
24096 type Message = MavMessage;
24097 const ID: u32 = 109u32;
24098 const NAME: &'static str = "RADIO_STATUS";
24099 const EXTRA_CRC: u8 = 185u8;
24100 const ENCODED_LEN: usize = 9usize;
24101 fn deser(
24102 _version: MavlinkVersion,
24103 __input: &[u8],
24104 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24105 let avail_len = __input.len();
24106 let mut payload_buf = [0; Self::ENCODED_LEN];
24107 let mut buf = if avail_len < Self::ENCODED_LEN {
24108 payload_buf[0..avail_len].copy_from_slice(__input);
24109 Bytes::new(&payload_buf)
24110 } else {
24111 Bytes::new(__input)
24112 };
24113 let mut __struct = Self::default();
24114 __struct.rxerrors = buf.get_u16_le();
24115 __struct.fixed = buf.get_u16_le();
24116 __struct.rssi = buf.get_u8();
24117 __struct.remrssi = buf.get_u8();
24118 __struct.txbuf = buf.get_u8();
24119 __struct.noise = buf.get_u8();
24120 __struct.remnoise = buf.get_u8();
24121 Ok(__struct)
24122 }
24123 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24124 let mut __tmp = BytesMut::new(bytes);
24125 #[allow(clippy::absurd_extreme_comparisons)]
24126 #[allow(unused_comparisons)]
24127 if __tmp.remaining() < Self::ENCODED_LEN {
24128 panic!(
24129 "buffer is too small (need {} bytes, but got {})",
24130 Self::ENCODED_LEN,
24131 __tmp.remaining(),
24132 )
24133 }
24134 __tmp.put_u16_le(self.rxerrors);
24135 __tmp.put_u16_le(self.fixed);
24136 __tmp.put_u8(self.rssi);
24137 __tmp.put_u8(self.remrssi);
24138 __tmp.put_u8(self.txbuf);
24139 __tmp.put_u8(self.noise);
24140 __tmp.put_u8(self.remnoise);
24141 if matches!(version, MavlinkVersion::V2) {
24142 let len = __tmp.len();
24143 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24144 } else {
24145 __tmp.len()
24146 }
24147 }
24148}
24149#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
24150#[doc = ""]
24151#[doc = "ID: 27"]
24152#[derive(Debug, Clone, PartialEq)]
24153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24155pub struct RAW_IMU_DATA {
24156 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24157 pub time_usec: u64,
24158 #[doc = "X acceleration (raw)"]
24159 pub xacc: i16,
24160 #[doc = "Y acceleration (raw)"]
24161 pub yacc: i16,
24162 #[doc = "Z acceleration (raw)"]
24163 pub zacc: i16,
24164 #[doc = "Angular speed around X axis (raw)"]
24165 pub xgyro: i16,
24166 #[doc = "Angular speed around Y axis (raw)"]
24167 pub ygyro: i16,
24168 #[doc = "Angular speed around Z axis (raw)"]
24169 pub zgyro: i16,
24170 #[doc = "X Magnetic field (raw)"]
24171 pub xmag: i16,
24172 #[doc = "Y Magnetic field (raw)"]
24173 pub ymag: i16,
24174 #[doc = "Z Magnetic field (raw)"]
24175 pub zmag: i16,
24176 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
24177 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24178 pub id: u8,
24179 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
24180 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24181 pub temperature: i16,
24182}
24183impl RAW_IMU_DATA {
24184 pub const ENCODED_LEN: usize = 29usize;
24185 pub const DEFAULT: Self = Self {
24186 time_usec: 0_u64,
24187 xacc: 0_i16,
24188 yacc: 0_i16,
24189 zacc: 0_i16,
24190 xgyro: 0_i16,
24191 ygyro: 0_i16,
24192 zgyro: 0_i16,
24193 xmag: 0_i16,
24194 ymag: 0_i16,
24195 zmag: 0_i16,
24196 id: 0_u8,
24197 temperature: 0_i16,
24198 };
24199 #[cfg(feature = "arbitrary")]
24200 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24201 use arbitrary::{Arbitrary, Unstructured};
24202 let mut buf = [0u8; 1024];
24203 rng.fill_bytes(&mut buf);
24204 let mut unstructured = Unstructured::new(&buf);
24205 Self::arbitrary(&mut unstructured).unwrap_or_default()
24206 }
24207}
24208impl Default for RAW_IMU_DATA {
24209 fn default() -> Self {
24210 Self::DEFAULT.clone()
24211 }
24212}
24213impl MessageData for RAW_IMU_DATA {
24214 type Message = MavMessage;
24215 const ID: u32 = 27u32;
24216 const NAME: &'static str = "RAW_IMU";
24217 const EXTRA_CRC: u8 = 144u8;
24218 const ENCODED_LEN: usize = 29usize;
24219 fn deser(
24220 _version: MavlinkVersion,
24221 __input: &[u8],
24222 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24223 let avail_len = __input.len();
24224 let mut payload_buf = [0; Self::ENCODED_LEN];
24225 let mut buf = if avail_len < Self::ENCODED_LEN {
24226 payload_buf[0..avail_len].copy_from_slice(__input);
24227 Bytes::new(&payload_buf)
24228 } else {
24229 Bytes::new(__input)
24230 };
24231 let mut __struct = Self::default();
24232 __struct.time_usec = buf.get_u64_le();
24233 __struct.xacc = buf.get_i16_le();
24234 __struct.yacc = buf.get_i16_le();
24235 __struct.zacc = buf.get_i16_le();
24236 __struct.xgyro = buf.get_i16_le();
24237 __struct.ygyro = buf.get_i16_le();
24238 __struct.zgyro = buf.get_i16_le();
24239 __struct.xmag = buf.get_i16_le();
24240 __struct.ymag = buf.get_i16_le();
24241 __struct.zmag = buf.get_i16_le();
24242 __struct.id = buf.get_u8();
24243 __struct.temperature = buf.get_i16_le();
24244 Ok(__struct)
24245 }
24246 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24247 let mut __tmp = BytesMut::new(bytes);
24248 #[allow(clippy::absurd_extreme_comparisons)]
24249 #[allow(unused_comparisons)]
24250 if __tmp.remaining() < Self::ENCODED_LEN {
24251 panic!(
24252 "buffer is too small (need {} bytes, but got {})",
24253 Self::ENCODED_LEN,
24254 __tmp.remaining(),
24255 )
24256 }
24257 __tmp.put_u64_le(self.time_usec);
24258 __tmp.put_i16_le(self.xacc);
24259 __tmp.put_i16_le(self.yacc);
24260 __tmp.put_i16_le(self.zacc);
24261 __tmp.put_i16_le(self.xgyro);
24262 __tmp.put_i16_le(self.ygyro);
24263 __tmp.put_i16_le(self.zgyro);
24264 __tmp.put_i16_le(self.xmag);
24265 __tmp.put_i16_le(self.ymag);
24266 __tmp.put_i16_le(self.zmag);
24267 if matches!(version, MavlinkVersion::V2) {
24268 __tmp.put_u8(self.id);
24269 __tmp.put_i16_le(self.temperature);
24270 let len = __tmp.len();
24271 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24272 } else {
24273 __tmp.len()
24274 }
24275 }
24276}
24277#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
24278#[doc = ""]
24279#[doc = "ID: 28"]
24280#[derive(Debug, Clone, PartialEq)]
24281#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24282#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24283pub struct RAW_PRESSURE_DATA {
24284 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24285 pub time_usec: u64,
24286 #[doc = "Absolute pressure (raw)"]
24287 pub press_abs: i16,
24288 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
24289 pub press_diff1: i16,
24290 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
24291 pub press_diff2: i16,
24292 #[doc = "Raw Temperature measurement (raw)"]
24293 pub temperature: i16,
24294}
24295impl RAW_PRESSURE_DATA {
24296 pub const ENCODED_LEN: usize = 16usize;
24297 pub const DEFAULT: Self = Self {
24298 time_usec: 0_u64,
24299 press_abs: 0_i16,
24300 press_diff1: 0_i16,
24301 press_diff2: 0_i16,
24302 temperature: 0_i16,
24303 };
24304 #[cfg(feature = "arbitrary")]
24305 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24306 use arbitrary::{Arbitrary, Unstructured};
24307 let mut buf = [0u8; 1024];
24308 rng.fill_bytes(&mut buf);
24309 let mut unstructured = Unstructured::new(&buf);
24310 Self::arbitrary(&mut unstructured).unwrap_or_default()
24311 }
24312}
24313impl Default for RAW_PRESSURE_DATA {
24314 fn default() -> Self {
24315 Self::DEFAULT.clone()
24316 }
24317}
24318impl MessageData for RAW_PRESSURE_DATA {
24319 type Message = MavMessage;
24320 const ID: u32 = 28u32;
24321 const NAME: &'static str = "RAW_PRESSURE";
24322 const EXTRA_CRC: u8 = 67u8;
24323 const ENCODED_LEN: usize = 16usize;
24324 fn deser(
24325 _version: MavlinkVersion,
24326 __input: &[u8],
24327 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24328 let avail_len = __input.len();
24329 let mut payload_buf = [0; Self::ENCODED_LEN];
24330 let mut buf = if avail_len < Self::ENCODED_LEN {
24331 payload_buf[0..avail_len].copy_from_slice(__input);
24332 Bytes::new(&payload_buf)
24333 } else {
24334 Bytes::new(__input)
24335 };
24336 let mut __struct = Self::default();
24337 __struct.time_usec = buf.get_u64_le();
24338 __struct.press_abs = buf.get_i16_le();
24339 __struct.press_diff1 = buf.get_i16_le();
24340 __struct.press_diff2 = buf.get_i16_le();
24341 __struct.temperature = buf.get_i16_le();
24342 Ok(__struct)
24343 }
24344 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24345 let mut __tmp = BytesMut::new(bytes);
24346 #[allow(clippy::absurd_extreme_comparisons)]
24347 #[allow(unused_comparisons)]
24348 if __tmp.remaining() < Self::ENCODED_LEN {
24349 panic!(
24350 "buffer is too small (need {} bytes, but got {})",
24351 Self::ENCODED_LEN,
24352 __tmp.remaining(),
24353 )
24354 }
24355 __tmp.put_u64_le(self.time_usec);
24356 __tmp.put_i16_le(self.press_abs);
24357 __tmp.put_i16_le(self.press_diff1);
24358 __tmp.put_i16_le(self.press_diff2);
24359 __tmp.put_i16_le(self.temperature);
24360 if matches!(version, MavlinkVersion::V2) {
24361 let len = __tmp.len();
24362 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24363 } else {
24364 __tmp.len()
24365 }
24366 }
24367}
24368#[doc = "RPM sensor data message."]
24369#[doc = ""]
24370#[doc = "ID: 339"]
24371#[derive(Debug, Clone, PartialEq)]
24372#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24373#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24374pub struct RAW_RPM_DATA {
24375 #[doc = "Indicated rate"]
24376 pub frequency: f32,
24377 #[doc = "Index of this RPM sensor (0-indexed)"]
24378 pub index: u8,
24379}
24380impl RAW_RPM_DATA {
24381 pub const ENCODED_LEN: usize = 5usize;
24382 pub const DEFAULT: Self = Self {
24383 frequency: 0.0_f32,
24384 index: 0_u8,
24385 };
24386 #[cfg(feature = "arbitrary")]
24387 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24388 use arbitrary::{Arbitrary, Unstructured};
24389 let mut buf = [0u8; 1024];
24390 rng.fill_bytes(&mut buf);
24391 let mut unstructured = Unstructured::new(&buf);
24392 Self::arbitrary(&mut unstructured).unwrap_or_default()
24393 }
24394}
24395impl Default for RAW_RPM_DATA {
24396 fn default() -> Self {
24397 Self::DEFAULT.clone()
24398 }
24399}
24400impl MessageData for RAW_RPM_DATA {
24401 type Message = MavMessage;
24402 const ID: u32 = 339u32;
24403 const NAME: &'static str = "RAW_RPM";
24404 const EXTRA_CRC: u8 = 199u8;
24405 const ENCODED_LEN: usize = 5usize;
24406 fn deser(
24407 _version: MavlinkVersion,
24408 __input: &[u8],
24409 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24410 let avail_len = __input.len();
24411 let mut payload_buf = [0; Self::ENCODED_LEN];
24412 let mut buf = if avail_len < Self::ENCODED_LEN {
24413 payload_buf[0..avail_len].copy_from_slice(__input);
24414 Bytes::new(&payload_buf)
24415 } else {
24416 Bytes::new(__input)
24417 };
24418 let mut __struct = Self::default();
24419 __struct.frequency = buf.get_f32_le();
24420 __struct.index = buf.get_u8();
24421 Ok(__struct)
24422 }
24423 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24424 let mut __tmp = BytesMut::new(bytes);
24425 #[allow(clippy::absurd_extreme_comparisons)]
24426 #[allow(unused_comparisons)]
24427 if __tmp.remaining() < Self::ENCODED_LEN {
24428 panic!(
24429 "buffer is too small (need {} bytes, but got {})",
24430 Self::ENCODED_LEN,
24431 __tmp.remaining(),
24432 )
24433 }
24434 __tmp.put_f32_le(self.frequency);
24435 __tmp.put_u8(self.index);
24436 if matches!(version, MavlinkVersion::V2) {
24437 let len = __tmp.len();
24438 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24439 } else {
24440 __tmp.len()
24441 }
24442 }
24443}
24444#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
24445#[doc = ""]
24446#[doc = "ID: 65"]
24447#[derive(Debug, Clone, PartialEq)]
24448#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24449#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24450pub struct RC_CHANNELS_DATA {
24451 #[doc = "Timestamp (time since system boot)."]
24452 pub time_boot_ms: u32,
24453 #[doc = "RC channel 1 value."]
24454 pub chan1_raw: u16,
24455 #[doc = "RC channel 2 value."]
24456 pub chan2_raw: u16,
24457 #[doc = "RC channel 3 value."]
24458 pub chan3_raw: u16,
24459 #[doc = "RC channel 4 value."]
24460 pub chan4_raw: u16,
24461 #[doc = "RC channel 5 value."]
24462 pub chan5_raw: u16,
24463 #[doc = "RC channel 6 value."]
24464 pub chan6_raw: u16,
24465 #[doc = "RC channel 7 value."]
24466 pub chan7_raw: u16,
24467 #[doc = "RC channel 8 value."]
24468 pub chan8_raw: u16,
24469 #[doc = "RC channel 9 value."]
24470 pub chan9_raw: u16,
24471 #[doc = "RC channel 10 value."]
24472 pub chan10_raw: u16,
24473 #[doc = "RC channel 11 value."]
24474 pub chan11_raw: u16,
24475 #[doc = "RC channel 12 value."]
24476 pub chan12_raw: u16,
24477 #[doc = "RC channel 13 value."]
24478 pub chan13_raw: u16,
24479 #[doc = "RC channel 14 value."]
24480 pub chan14_raw: u16,
24481 #[doc = "RC channel 15 value."]
24482 pub chan15_raw: u16,
24483 #[doc = "RC channel 16 value."]
24484 pub chan16_raw: u16,
24485 #[doc = "RC channel 17 value."]
24486 pub chan17_raw: u16,
24487 #[doc = "RC channel 18 value."]
24488 pub chan18_raw: u16,
24489 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
24490 pub chancount: u8,
24491 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24492 pub rssi: u8,
24493}
24494impl RC_CHANNELS_DATA {
24495 pub const ENCODED_LEN: usize = 42usize;
24496 pub const DEFAULT: Self = Self {
24497 time_boot_ms: 0_u32,
24498 chan1_raw: 0_u16,
24499 chan2_raw: 0_u16,
24500 chan3_raw: 0_u16,
24501 chan4_raw: 0_u16,
24502 chan5_raw: 0_u16,
24503 chan6_raw: 0_u16,
24504 chan7_raw: 0_u16,
24505 chan8_raw: 0_u16,
24506 chan9_raw: 0_u16,
24507 chan10_raw: 0_u16,
24508 chan11_raw: 0_u16,
24509 chan12_raw: 0_u16,
24510 chan13_raw: 0_u16,
24511 chan14_raw: 0_u16,
24512 chan15_raw: 0_u16,
24513 chan16_raw: 0_u16,
24514 chan17_raw: 0_u16,
24515 chan18_raw: 0_u16,
24516 chancount: 0_u8,
24517 rssi: 0_u8,
24518 };
24519 #[cfg(feature = "arbitrary")]
24520 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24521 use arbitrary::{Arbitrary, Unstructured};
24522 let mut buf = [0u8; 1024];
24523 rng.fill_bytes(&mut buf);
24524 let mut unstructured = Unstructured::new(&buf);
24525 Self::arbitrary(&mut unstructured).unwrap_or_default()
24526 }
24527}
24528impl Default for RC_CHANNELS_DATA {
24529 fn default() -> Self {
24530 Self::DEFAULT.clone()
24531 }
24532}
24533impl MessageData for RC_CHANNELS_DATA {
24534 type Message = MavMessage;
24535 const ID: u32 = 65u32;
24536 const NAME: &'static str = "RC_CHANNELS";
24537 const EXTRA_CRC: u8 = 118u8;
24538 const ENCODED_LEN: usize = 42usize;
24539 fn deser(
24540 _version: MavlinkVersion,
24541 __input: &[u8],
24542 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24543 let avail_len = __input.len();
24544 let mut payload_buf = [0; Self::ENCODED_LEN];
24545 let mut buf = if avail_len < Self::ENCODED_LEN {
24546 payload_buf[0..avail_len].copy_from_slice(__input);
24547 Bytes::new(&payload_buf)
24548 } else {
24549 Bytes::new(__input)
24550 };
24551 let mut __struct = Self::default();
24552 __struct.time_boot_ms = buf.get_u32_le();
24553 __struct.chan1_raw = buf.get_u16_le();
24554 __struct.chan2_raw = buf.get_u16_le();
24555 __struct.chan3_raw = buf.get_u16_le();
24556 __struct.chan4_raw = buf.get_u16_le();
24557 __struct.chan5_raw = buf.get_u16_le();
24558 __struct.chan6_raw = buf.get_u16_le();
24559 __struct.chan7_raw = buf.get_u16_le();
24560 __struct.chan8_raw = buf.get_u16_le();
24561 __struct.chan9_raw = buf.get_u16_le();
24562 __struct.chan10_raw = buf.get_u16_le();
24563 __struct.chan11_raw = buf.get_u16_le();
24564 __struct.chan12_raw = buf.get_u16_le();
24565 __struct.chan13_raw = buf.get_u16_le();
24566 __struct.chan14_raw = buf.get_u16_le();
24567 __struct.chan15_raw = buf.get_u16_le();
24568 __struct.chan16_raw = buf.get_u16_le();
24569 __struct.chan17_raw = buf.get_u16_le();
24570 __struct.chan18_raw = buf.get_u16_le();
24571 __struct.chancount = buf.get_u8();
24572 __struct.rssi = buf.get_u8();
24573 Ok(__struct)
24574 }
24575 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24576 let mut __tmp = BytesMut::new(bytes);
24577 #[allow(clippy::absurd_extreme_comparisons)]
24578 #[allow(unused_comparisons)]
24579 if __tmp.remaining() < Self::ENCODED_LEN {
24580 panic!(
24581 "buffer is too small (need {} bytes, but got {})",
24582 Self::ENCODED_LEN,
24583 __tmp.remaining(),
24584 )
24585 }
24586 __tmp.put_u32_le(self.time_boot_ms);
24587 __tmp.put_u16_le(self.chan1_raw);
24588 __tmp.put_u16_le(self.chan2_raw);
24589 __tmp.put_u16_le(self.chan3_raw);
24590 __tmp.put_u16_le(self.chan4_raw);
24591 __tmp.put_u16_le(self.chan5_raw);
24592 __tmp.put_u16_le(self.chan6_raw);
24593 __tmp.put_u16_le(self.chan7_raw);
24594 __tmp.put_u16_le(self.chan8_raw);
24595 __tmp.put_u16_le(self.chan9_raw);
24596 __tmp.put_u16_le(self.chan10_raw);
24597 __tmp.put_u16_le(self.chan11_raw);
24598 __tmp.put_u16_le(self.chan12_raw);
24599 __tmp.put_u16_le(self.chan13_raw);
24600 __tmp.put_u16_le(self.chan14_raw);
24601 __tmp.put_u16_le(self.chan15_raw);
24602 __tmp.put_u16_le(self.chan16_raw);
24603 __tmp.put_u16_le(self.chan17_raw);
24604 __tmp.put_u16_le(self.chan18_raw);
24605 __tmp.put_u8(self.chancount);
24606 __tmp.put_u8(self.rssi);
24607 if matches!(version, MavlinkVersion::V2) {
24608 let len = __tmp.len();
24609 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24610 } else {
24611 __tmp.len()
24612 }
24613 }
24614}
24615#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
24616#[doc = ""]
24617#[doc = "ID: 70"]
24618#[derive(Debug, Clone, PartialEq)]
24619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24620#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24621pub struct RC_CHANNELS_OVERRIDE_DATA {
24622 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24623 pub chan1_raw: u16,
24624 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24625 pub chan2_raw: u16,
24626 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24627 pub chan3_raw: u16,
24628 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24629 pub chan4_raw: u16,
24630 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24631 pub chan5_raw: u16,
24632 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24633 pub chan6_raw: u16,
24634 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24635 pub chan7_raw: u16,
24636 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24637 pub chan8_raw: u16,
24638 #[doc = "System ID"]
24639 pub target_system: u8,
24640 #[doc = "Component ID"]
24641 pub target_component: u8,
24642 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24643 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24644 pub chan9_raw: u16,
24645 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24646 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24647 pub chan10_raw: u16,
24648 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24649 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24650 pub chan11_raw: u16,
24651 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24652 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24653 pub chan12_raw: u16,
24654 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24655 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24656 pub chan13_raw: u16,
24657 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24658 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24659 pub chan14_raw: u16,
24660 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24661 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24662 pub chan15_raw: u16,
24663 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24664 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24665 pub chan16_raw: u16,
24666 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24667 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24668 pub chan17_raw: u16,
24669 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24670 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24671 pub chan18_raw: u16,
24672}
24673impl RC_CHANNELS_OVERRIDE_DATA {
24674 pub const ENCODED_LEN: usize = 38usize;
24675 pub const DEFAULT: Self = Self {
24676 chan1_raw: 0_u16,
24677 chan2_raw: 0_u16,
24678 chan3_raw: 0_u16,
24679 chan4_raw: 0_u16,
24680 chan5_raw: 0_u16,
24681 chan6_raw: 0_u16,
24682 chan7_raw: 0_u16,
24683 chan8_raw: 0_u16,
24684 target_system: 0_u8,
24685 target_component: 0_u8,
24686 chan9_raw: 0_u16,
24687 chan10_raw: 0_u16,
24688 chan11_raw: 0_u16,
24689 chan12_raw: 0_u16,
24690 chan13_raw: 0_u16,
24691 chan14_raw: 0_u16,
24692 chan15_raw: 0_u16,
24693 chan16_raw: 0_u16,
24694 chan17_raw: 0_u16,
24695 chan18_raw: 0_u16,
24696 };
24697 #[cfg(feature = "arbitrary")]
24698 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24699 use arbitrary::{Arbitrary, Unstructured};
24700 let mut buf = [0u8; 1024];
24701 rng.fill_bytes(&mut buf);
24702 let mut unstructured = Unstructured::new(&buf);
24703 Self::arbitrary(&mut unstructured).unwrap_or_default()
24704 }
24705}
24706impl Default for RC_CHANNELS_OVERRIDE_DATA {
24707 fn default() -> Self {
24708 Self::DEFAULT.clone()
24709 }
24710}
24711impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
24712 type Message = MavMessage;
24713 const ID: u32 = 70u32;
24714 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
24715 const EXTRA_CRC: u8 = 124u8;
24716 const ENCODED_LEN: usize = 38usize;
24717 fn deser(
24718 _version: MavlinkVersion,
24719 __input: &[u8],
24720 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24721 let avail_len = __input.len();
24722 let mut payload_buf = [0; Self::ENCODED_LEN];
24723 let mut buf = if avail_len < Self::ENCODED_LEN {
24724 payload_buf[0..avail_len].copy_from_slice(__input);
24725 Bytes::new(&payload_buf)
24726 } else {
24727 Bytes::new(__input)
24728 };
24729 let mut __struct = Self::default();
24730 __struct.chan1_raw = buf.get_u16_le();
24731 __struct.chan2_raw = buf.get_u16_le();
24732 __struct.chan3_raw = buf.get_u16_le();
24733 __struct.chan4_raw = buf.get_u16_le();
24734 __struct.chan5_raw = buf.get_u16_le();
24735 __struct.chan6_raw = buf.get_u16_le();
24736 __struct.chan7_raw = buf.get_u16_le();
24737 __struct.chan8_raw = buf.get_u16_le();
24738 __struct.target_system = buf.get_u8();
24739 __struct.target_component = buf.get_u8();
24740 __struct.chan9_raw = buf.get_u16_le();
24741 __struct.chan10_raw = buf.get_u16_le();
24742 __struct.chan11_raw = buf.get_u16_le();
24743 __struct.chan12_raw = buf.get_u16_le();
24744 __struct.chan13_raw = buf.get_u16_le();
24745 __struct.chan14_raw = buf.get_u16_le();
24746 __struct.chan15_raw = buf.get_u16_le();
24747 __struct.chan16_raw = buf.get_u16_le();
24748 __struct.chan17_raw = buf.get_u16_le();
24749 __struct.chan18_raw = buf.get_u16_le();
24750 Ok(__struct)
24751 }
24752 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24753 let mut __tmp = BytesMut::new(bytes);
24754 #[allow(clippy::absurd_extreme_comparisons)]
24755 #[allow(unused_comparisons)]
24756 if __tmp.remaining() < Self::ENCODED_LEN {
24757 panic!(
24758 "buffer is too small (need {} bytes, but got {})",
24759 Self::ENCODED_LEN,
24760 __tmp.remaining(),
24761 )
24762 }
24763 __tmp.put_u16_le(self.chan1_raw);
24764 __tmp.put_u16_le(self.chan2_raw);
24765 __tmp.put_u16_le(self.chan3_raw);
24766 __tmp.put_u16_le(self.chan4_raw);
24767 __tmp.put_u16_le(self.chan5_raw);
24768 __tmp.put_u16_le(self.chan6_raw);
24769 __tmp.put_u16_le(self.chan7_raw);
24770 __tmp.put_u16_le(self.chan8_raw);
24771 __tmp.put_u8(self.target_system);
24772 __tmp.put_u8(self.target_component);
24773 if matches!(version, MavlinkVersion::V2) {
24774 __tmp.put_u16_le(self.chan9_raw);
24775 __tmp.put_u16_le(self.chan10_raw);
24776 __tmp.put_u16_le(self.chan11_raw);
24777 __tmp.put_u16_le(self.chan12_raw);
24778 __tmp.put_u16_le(self.chan13_raw);
24779 __tmp.put_u16_le(self.chan14_raw);
24780 __tmp.put_u16_le(self.chan15_raw);
24781 __tmp.put_u16_le(self.chan16_raw);
24782 __tmp.put_u16_le(self.chan17_raw);
24783 __tmp.put_u16_le(self.chan18_raw);
24784 let len = __tmp.len();
24785 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24786 } else {
24787 __tmp.len()
24788 }
24789 }
24790}
24791#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
24792#[doc = ""]
24793#[doc = "ID: 35"]
24794#[derive(Debug, Clone, PartialEq)]
24795#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24796#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24797pub struct RC_CHANNELS_RAW_DATA {
24798 #[doc = "Timestamp (time since system boot)."]
24799 pub time_boot_ms: u32,
24800 #[doc = "RC channel 1 value."]
24801 pub chan1_raw: u16,
24802 #[doc = "RC channel 2 value."]
24803 pub chan2_raw: u16,
24804 #[doc = "RC channel 3 value."]
24805 pub chan3_raw: u16,
24806 #[doc = "RC channel 4 value."]
24807 pub chan4_raw: u16,
24808 #[doc = "RC channel 5 value."]
24809 pub chan5_raw: u16,
24810 #[doc = "RC channel 6 value."]
24811 pub chan6_raw: u16,
24812 #[doc = "RC channel 7 value."]
24813 pub chan7_raw: u16,
24814 #[doc = "RC channel 8 value."]
24815 pub chan8_raw: u16,
24816 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
24817 pub port: u8,
24818 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24819 pub rssi: u8,
24820}
24821impl RC_CHANNELS_RAW_DATA {
24822 pub const ENCODED_LEN: usize = 22usize;
24823 pub const DEFAULT: Self = Self {
24824 time_boot_ms: 0_u32,
24825 chan1_raw: 0_u16,
24826 chan2_raw: 0_u16,
24827 chan3_raw: 0_u16,
24828 chan4_raw: 0_u16,
24829 chan5_raw: 0_u16,
24830 chan6_raw: 0_u16,
24831 chan7_raw: 0_u16,
24832 chan8_raw: 0_u16,
24833 port: 0_u8,
24834 rssi: 0_u8,
24835 };
24836 #[cfg(feature = "arbitrary")]
24837 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24838 use arbitrary::{Arbitrary, Unstructured};
24839 let mut buf = [0u8; 1024];
24840 rng.fill_bytes(&mut buf);
24841 let mut unstructured = Unstructured::new(&buf);
24842 Self::arbitrary(&mut unstructured).unwrap_or_default()
24843 }
24844}
24845impl Default for RC_CHANNELS_RAW_DATA {
24846 fn default() -> Self {
24847 Self::DEFAULT.clone()
24848 }
24849}
24850impl MessageData for RC_CHANNELS_RAW_DATA {
24851 type Message = MavMessage;
24852 const ID: u32 = 35u32;
24853 const NAME: &'static str = "RC_CHANNELS_RAW";
24854 const EXTRA_CRC: u8 = 244u8;
24855 const ENCODED_LEN: usize = 22usize;
24856 fn deser(
24857 _version: MavlinkVersion,
24858 __input: &[u8],
24859 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24860 let avail_len = __input.len();
24861 let mut payload_buf = [0; Self::ENCODED_LEN];
24862 let mut buf = if avail_len < Self::ENCODED_LEN {
24863 payload_buf[0..avail_len].copy_from_slice(__input);
24864 Bytes::new(&payload_buf)
24865 } else {
24866 Bytes::new(__input)
24867 };
24868 let mut __struct = Self::default();
24869 __struct.time_boot_ms = buf.get_u32_le();
24870 __struct.chan1_raw = buf.get_u16_le();
24871 __struct.chan2_raw = buf.get_u16_le();
24872 __struct.chan3_raw = buf.get_u16_le();
24873 __struct.chan4_raw = buf.get_u16_le();
24874 __struct.chan5_raw = buf.get_u16_le();
24875 __struct.chan6_raw = buf.get_u16_le();
24876 __struct.chan7_raw = buf.get_u16_le();
24877 __struct.chan8_raw = buf.get_u16_le();
24878 __struct.port = buf.get_u8();
24879 __struct.rssi = buf.get_u8();
24880 Ok(__struct)
24881 }
24882 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24883 let mut __tmp = BytesMut::new(bytes);
24884 #[allow(clippy::absurd_extreme_comparisons)]
24885 #[allow(unused_comparisons)]
24886 if __tmp.remaining() < Self::ENCODED_LEN {
24887 panic!(
24888 "buffer is too small (need {} bytes, but got {})",
24889 Self::ENCODED_LEN,
24890 __tmp.remaining(),
24891 )
24892 }
24893 __tmp.put_u32_le(self.time_boot_ms);
24894 __tmp.put_u16_le(self.chan1_raw);
24895 __tmp.put_u16_le(self.chan2_raw);
24896 __tmp.put_u16_le(self.chan3_raw);
24897 __tmp.put_u16_le(self.chan4_raw);
24898 __tmp.put_u16_le(self.chan5_raw);
24899 __tmp.put_u16_le(self.chan6_raw);
24900 __tmp.put_u16_le(self.chan7_raw);
24901 __tmp.put_u16_le(self.chan8_raw);
24902 __tmp.put_u8(self.port);
24903 __tmp.put_u8(self.rssi);
24904 if matches!(version, MavlinkVersion::V2) {
24905 let len = __tmp.len();
24906 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24907 } else {
24908 __tmp.len()
24909 }
24910 }
24911}
24912#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
24913#[doc = ""]
24914#[doc = "ID: 34"]
24915#[derive(Debug, Clone, PartialEq)]
24916#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24917#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24918pub struct RC_CHANNELS_SCALED_DATA {
24919 #[doc = "Timestamp (time since system boot)."]
24920 pub time_boot_ms: u32,
24921 #[doc = "RC channel 1 value scaled."]
24922 pub chan1_scaled: i16,
24923 #[doc = "RC channel 2 value scaled."]
24924 pub chan2_scaled: i16,
24925 #[doc = "RC channel 3 value scaled."]
24926 pub chan3_scaled: i16,
24927 #[doc = "RC channel 4 value scaled."]
24928 pub chan4_scaled: i16,
24929 #[doc = "RC channel 5 value scaled."]
24930 pub chan5_scaled: i16,
24931 #[doc = "RC channel 6 value scaled."]
24932 pub chan6_scaled: i16,
24933 #[doc = "RC channel 7 value scaled."]
24934 pub chan7_scaled: i16,
24935 #[doc = "RC channel 8 value scaled."]
24936 pub chan8_scaled: i16,
24937 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
24938 pub port: u8,
24939 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24940 pub rssi: u8,
24941}
24942impl RC_CHANNELS_SCALED_DATA {
24943 pub const ENCODED_LEN: usize = 22usize;
24944 pub const DEFAULT: Self = Self {
24945 time_boot_ms: 0_u32,
24946 chan1_scaled: 0_i16,
24947 chan2_scaled: 0_i16,
24948 chan3_scaled: 0_i16,
24949 chan4_scaled: 0_i16,
24950 chan5_scaled: 0_i16,
24951 chan6_scaled: 0_i16,
24952 chan7_scaled: 0_i16,
24953 chan8_scaled: 0_i16,
24954 port: 0_u8,
24955 rssi: 0_u8,
24956 };
24957 #[cfg(feature = "arbitrary")]
24958 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24959 use arbitrary::{Arbitrary, Unstructured};
24960 let mut buf = [0u8; 1024];
24961 rng.fill_bytes(&mut buf);
24962 let mut unstructured = Unstructured::new(&buf);
24963 Self::arbitrary(&mut unstructured).unwrap_or_default()
24964 }
24965}
24966impl Default for RC_CHANNELS_SCALED_DATA {
24967 fn default() -> Self {
24968 Self::DEFAULT.clone()
24969 }
24970}
24971impl MessageData for RC_CHANNELS_SCALED_DATA {
24972 type Message = MavMessage;
24973 const ID: u32 = 34u32;
24974 const NAME: &'static str = "RC_CHANNELS_SCALED";
24975 const EXTRA_CRC: u8 = 237u8;
24976 const ENCODED_LEN: usize = 22usize;
24977 fn deser(
24978 _version: MavlinkVersion,
24979 __input: &[u8],
24980 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24981 let avail_len = __input.len();
24982 let mut payload_buf = [0; Self::ENCODED_LEN];
24983 let mut buf = if avail_len < Self::ENCODED_LEN {
24984 payload_buf[0..avail_len].copy_from_slice(__input);
24985 Bytes::new(&payload_buf)
24986 } else {
24987 Bytes::new(__input)
24988 };
24989 let mut __struct = Self::default();
24990 __struct.time_boot_ms = buf.get_u32_le();
24991 __struct.chan1_scaled = buf.get_i16_le();
24992 __struct.chan2_scaled = buf.get_i16_le();
24993 __struct.chan3_scaled = buf.get_i16_le();
24994 __struct.chan4_scaled = buf.get_i16_le();
24995 __struct.chan5_scaled = buf.get_i16_le();
24996 __struct.chan6_scaled = buf.get_i16_le();
24997 __struct.chan7_scaled = buf.get_i16_le();
24998 __struct.chan8_scaled = buf.get_i16_le();
24999 __struct.port = buf.get_u8();
25000 __struct.rssi = buf.get_u8();
25001 Ok(__struct)
25002 }
25003 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25004 let mut __tmp = BytesMut::new(bytes);
25005 #[allow(clippy::absurd_extreme_comparisons)]
25006 #[allow(unused_comparisons)]
25007 if __tmp.remaining() < Self::ENCODED_LEN {
25008 panic!(
25009 "buffer is too small (need {} bytes, but got {})",
25010 Self::ENCODED_LEN,
25011 __tmp.remaining(),
25012 )
25013 }
25014 __tmp.put_u32_le(self.time_boot_ms);
25015 __tmp.put_i16_le(self.chan1_scaled);
25016 __tmp.put_i16_le(self.chan2_scaled);
25017 __tmp.put_i16_le(self.chan3_scaled);
25018 __tmp.put_i16_le(self.chan4_scaled);
25019 __tmp.put_i16_le(self.chan5_scaled);
25020 __tmp.put_i16_le(self.chan6_scaled);
25021 __tmp.put_i16_le(self.chan7_scaled);
25022 __tmp.put_i16_le(self.chan8_scaled);
25023 __tmp.put_u8(self.port);
25024 __tmp.put_u8(self.rssi);
25025 if matches!(version, MavlinkVersion::V2) {
25026 let len = __tmp.len();
25027 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25028 } else {
25029 __tmp.len()
25030 }
25031 }
25032}
25033#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
25034#[doc = "Request a data stream."]
25035#[doc = ""]
25036#[doc = "ID: 66"]
25037#[derive(Debug, Clone, PartialEq)]
25038#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25039#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25040pub struct REQUEST_DATA_STREAM_DATA {
25041 #[doc = "The requested message rate"]
25042 pub req_message_rate: u16,
25043 #[doc = "The target requested to send the message stream."]
25044 pub target_system: u8,
25045 #[doc = "The target requested to send the message stream."]
25046 pub target_component: u8,
25047 #[doc = "The ID of the requested data stream"]
25048 pub req_stream_id: u8,
25049 #[doc = "1 to start sending, 0 to stop sending."]
25050 pub start_stop: u8,
25051}
25052impl REQUEST_DATA_STREAM_DATA {
25053 pub const ENCODED_LEN: usize = 6usize;
25054 pub const DEFAULT: Self = Self {
25055 req_message_rate: 0_u16,
25056 target_system: 0_u8,
25057 target_component: 0_u8,
25058 req_stream_id: 0_u8,
25059 start_stop: 0_u8,
25060 };
25061 #[cfg(feature = "arbitrary")]
25062 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25063 use arbitrary::{Arbitrary, Unstructured};
25064 let mut buf = [0u8; 1024];
25065 rng.fill_bytes(&mut buf);
25066 let mut unstructured = Unstructured::new(&buf);
25067 Self::arbitrary(&mut unstructured).unwrap_or_default()
25068 }
25069}
25070impl Default for REQUEST_DATA_STREAM_DATA {
25071 fn default() -> Self {
25072 Self::DEFAULT.clone()
25073 }
25074}
25075impl MessageData for REQUEST_DATA_STREAM_DATA {
25076 type Message = MavMessage;
25077 const ID: u32 = 66u32;
25078 const NAME: &'static str = "REQUEST_DATA_STREAM";
25079 const EXTRA_CRC: u8 = 148u8;
25080 const ENCODED_LEN: usize = 6usize;
25081 fn deser(
25082 _version: MavlinkVersion,
25083 __input: &[u8],
25084 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25085 let avail_len = __input.len();
25086 let mut payload_buf = [0; Self::ENCODED_LEN];
25087 let mut buf = if avail_len < Self::ENCODED_LEN {
25088 payload_buf[0..avail_len].copy_from_slice(__input);
25089 Bytes::new(&payload_buf)
25090 } else {
25091 Bytes::new(__input)
25092 };
25093 let mut __struct = Self::default();
25094 __struct.req_message_rate = buf.get_u16_le();
25095 __struct.target_system = buf.get_u8();
25096 __struct.target_component = buf.get_u8();
25097 __struct.req_stream_id = buf.get_u8();
25098 __struct.start_stop = buf.get_u8();
25099 Ok(__struct)
25100 }
25101 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25102 let mut __tmp = BytesMut::new(bytes);
25103 #[allow(clippy::absurd_extreme_comparisons)]
25104 #[allow(unused_comparisons)]
25105 if __tmp.remaining() < Self::ENCODED_LEN {
25106 panic!(
25107 "buffer is too small (need {} bytes, but got {})",
25108 Self::ENCODED_LEN,
25109 __tmp.remaining(),
25110 )
25111 }
25112 __tmp.put_u16_le(self.req_message_rate);
25113 __tmp.put_u8(self.target_system);
25114 __tmp.put_u8(self.target_component);
25115 __tmp.put_u8(self.req_stream_id);
25116 __tmp.put_u8(self.start_stop);
25117 if matches!(version, MavlinkVersion::V2) {
25118 let len = __tmp.len();
25119 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25120 } else {
25121 __tmp.len()
25122 }
25123 }
25124}
25125#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
25126#[doc = ""]
25127#[doc = "ID: 412"]
25128#[derive(Debug, Clone, PartialEq)]
25129#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25131pub struct REQUEST_EVENT_DATA {
25132 #[doc = "First sequence number of the requested event."]
25133 pub first_sequence: u16,
25134 #[doc = "Last sequence number of the requested event."]
25135 pub last_sequence: u16,
25136 #[doc = "System ID"]
25137 pub target_system: u8,
25138 #[doc = "Component ID"]
25139 pub target_component: u8,
25140}
25141impl REQUEST_EVENT_DATA {
25142 pub const ENCODED_LEN: usize = 6usize;
25143 pub const DEFAULT: Self = Self {
25144 first_sequence: 0_u16,
25145 last_sequence: 0_u16,
25146 target_system: 0_u8,
25147 target_component: 0_u8,
25148 };
25149 #[cfg(feature = "arbitrary")]
25150 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25151 use arbitrary::{Arbitrary, Unstructured};
25152 let mut buf = [0u8; 1024];
25153 rng.fill_bytes(&mut buf);
25154 let mut unstructured = Unstructured::new(&buf);
25155 Self::arbitrary(&mut unstructured).unwrap_or_default()
25156 }
25157}
25158impl Default for REQUEST_EVENT_DATA {
25159 fn default() -> Self {
25160 Self::DEFAULT.clone()
25161 }
25162}
25163impl MessageData for REQUEST_EVENT_DATA {
25164 type Message = MavMessage;
25165 const ID: u32 = 412u32;
25166 const NAME: &'static str = "REQUEST_EVENT";
25167 const EXTRA_CRC: u8 = 33u8;
25168 const ENCODED_LEN: usize = 6usize;
25169 fn deser(
25170 _version: MavlinkVersion,
25171 __input: &[u8],
25172 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25173 let avail_len = __input.len();
25174 let mut payload_buf = [0; Self::ENCODED_LEN];
25175 let mut buf = if avail_len < Self::ENCODED_LEN {
25176 payload_buf[0..avail_len].copy_from_slice(__input);
25177 Bytes::new(&payload_buf)
25178 } else {
25179 Bytes::new(__input)
25180 };
25181 let mut __struct = Self::default();
25182 __struct.first_sequence = buf.get_u16_le();
25183 __struct.last_sequence = buf.get_u16_le();
25184 __struct.target_system = buf.get_u8();
25185 __struct.target_component = buf.get_u8();
25186 Ok(__struct)
25187 }
25188 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25189 let mut __tmp = BytesMut::new(bytes);
25190 #[allow(clippy::absurd_extreme_comparisons)]
25191 #[allow(unused_comparisons)]
25192 if __tmp.remaining() < Self::ENCODED_LEN {
25193 panic!(
25194 "buffer is too small (need {} bytes, but got {})",
25195 Self::ENCODED_LEN,
25196 __tmp.remaining(),
25197 )
25198 }
25199 __tmp.put_u16_le(self.first_sequence);
25200 __tmp.put_u16_le(self.last_sequence);
25201 __tmp.put_u8(self.target_system);
25202 __tmp.put_u8(self.target_component);
25203 if matches!(version, MavlinkVersion::V2) {
25204 let len = __tmp.len();
25205 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25206 } else {
25207 __tmp.len()
25208 }
25209 }
25210}
25211#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
25212#[doc = ""]
25213#[doc = "ID: 142"]
25214#[derive(Debug, Clone, PartialEq)]
25215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25216#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25217pub struct RESOURCE_REQUEST_DATA {
25218 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
25219 pub request_id: u8,
25220 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
25221 pub uri_type: u8,
25222 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
25223 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25224 pub uri: [u8; 120],
25225 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
25226 pub transfer_type: u8,
25227 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
25228 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25229 pub storage: [u8; 120],
25230}
25231impl RESOURCE_REQUEST_DATA {
25232 pub const ENCODED_LEN: usize = 243usize;
25233 pub const DEFAULT: Self = Self {
25234 request_id: 0_u8,
25235 uri_type: 0_u8,
25236 uri: [0_u8; 120usize],
25237 transfer_type: 0_u8,
25238 storage: [0_u8; 120usize],
25239 };
25240 #[cfg(feature = "arbitrary")]
25241 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25242 use arbitrary::{Arbitrary, Unstructured};
25243 let mut buf = [0u8; 1024];
25244 rng.fill_bytes(&mut buf);
25245 let mut unstructured = Unstructured::new(&buf);
25246 Self::arbitrary(&mut unstructured).unwrap_or_default()
25247 }
25248}
25249impl Default for RESOURCE_REQUEST_DATA {
25250 fn default() -> Self {
25251 Self::DEFAULT.clone()
25252 }
25253}
25254impl MessageData for RESOURCE_REQUEST_DATA {
25255 type Message = MavMessage;
25256 const ID: u32 = 142u32;
25257 const NAME: &'static str = "RESOURCE_REQUEST";
25258 const EXTRA_CRC: u8 = 72u8;
25259 const ENCODED_LEN: usize = 243usize;
25260 fn deser(
25261 _version: MavlinkVersion,
25262 __input: &[u8],
25263 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25264 let avail_len = __input.len();
25265 let mut payload_buf = [0; Self::ENCODED_LEN];
25266 let mut buf = if avail_len < Self::ENCODED_LEN {
25267 payload_buf[0..avail_len].copy_from_slice(__input);
25268 Bytes::new(&payload_buf)
25269 } else {
25270 Bytes::new(__input)
25271 };
25272 let mut __struct = Self::default();
25273 __struct.request_id = buf.get_u8();
25274 __struct.uri_type = buf.get_u8();
25275 for v in &mut __struct.uri {
25276 let val = buf.get_u8();
25277 *v = val;
25278 }
25279 __struct.transfer_type = buf.get_u8();
25280 for v in &mut __struct.storage {
25281 let val = buf.get_u8();
25282 *v = val;
25283 }
25284 Ok(__struct)
25285 }
25286 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25287 let mut __tmp = BytesMut::new(bytes);
25288 #[allow(clippy::absurd_extreme_comparisons)]
25289 #[allow(unused_comparisons)]
25290 if __tmp.remaining() < Self::ENCODED_LEN {
25291 panic!(
25292 "buffer is too small (need {} bytes, but got {})",
25293 Self::ENCODED_LEN,
25294 __tmp.remaining(),
25295 )
25296 }
25297 __tmp.put_u8(self.request_id);
25298 __tmp.put_u8(self.uri_type);
25299 for val in &self.uri {
25300 __tmp.put_u8(*val);
25301 }
25302 __tmp.put_u8(self.transfer_type);
25303 for val in &self.storage {
25304 __tmp.put_u8(*val);
25305 }
25306 if matches!(version, MavlinkVersion::V2) {
25307 let len = __tmp.len();
25308 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25309 } else {
25310 __tmp.len()
25311 }
25312 }
25313}
25314#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
25315#[doc = ""]
25316#[doc = "ID: 413"]
25317#[derive(Debug, Clone, PartialEq)]
25318#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25319#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25320pub struct RESPONSE_EVENT_ERROR_DATA {
25321 #[doc = "Sequence number."]
25322 pub sequence: u16,
25323 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
25324 pub sequence_oldest_available: u16,
25325 #[doc = "System ID"]
25326 pub target_system: u8,
25327 #[doc = "Component ID"]
25328 pub target_component: u8,
25329 #[doc = "Error reason."]
25330 pub reason: MavEventErrorReason,
25331}
25332impl RESPONSE_EVENT_ERROR_DATA {
25333 pub const ENCODED_LEN: usize = 7usize;
25334 pub const DEFAULT: Self = Self {
25335 sequence: 0_u16,
25336 sequence_oldest_available: 0_u16,
25337 target_system: 0_u8,
25338 target_component: 0_u8,
25339 reason: MavEventErrorReason::DEFAULT,
25340 };
25341 #[cfg(feature = "arbitrary")]
25342 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25343 use arbitrary::{Arbitrary, Unstructured};
25344 let mut buf = [0u8; 1024];
25345 rng.fill_bytes(&mut buf);
25346 let mut unstructured = Unstructured::new(&buf);
25347 Self::arbitrary(&mut unstructured).unwrap_or_default()
25348 }
25349}
25350impl Default for RESPONSE_EVENT_ERROR_DATA {
25351 fn default() -> Self {
25352 Self::DEFAULT.clone()
25353 }
25354}
25355impl MessageData for RESPONSE_EVENT_ERROR_DATA {
25356 type Message = MavMessage;
25357 const ID: u32 = 413u32;
25358 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
25359 const EXTRA_CRC: u8 = 77u8;
25360 const ENCODED_LEN: usize = 7usize;
25361 fn deser(
25362 _version: MavlinkVersion,
25363 __input: &[u8],
25364 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25365 let avail_len = __input.len();
25366 let mut payload_buf = [0; Self::ENCODED_LEN];
25367 let mut buf = if avail_len < Self::ENCODED_LEN {
25368 payload_buf[0..avail_len].copy_from_slice(__input);
25369 Bytes::new(&payload_buf)
25370 } else {
25371 Bytes::new(__input)
25372 };
25373 let mut __struct = Self::default();
25374 __struct.sequence = buf.get_u16_le();
25375 __struct.sequence_oldest_available = buf.get_u16_le();
25376 __struct.target_system = buf.get_u8();
25377 __struct.target_component = buf.get_u8();
25378 let tmp = buf.get_u8();
25379 __struct.reason =
25380 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25381 enum_type: "MavEventErrorReason",
25382 value: tmp as u32,
25383 })?;
25384 Ok(__struct)
25385 }
25386 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25387 let mut __tmp = BytesMut::new(bytes);
25388 #[allow(clippy::absurd_extreme_comparisons)]
25389 #[allow(unused_comparisons)]
25390 if __tmp.remaining() < Self::ENCODED_LEN {
25391 panic!(
25392 "buffer is too small (need {} bytes, but got {})",
25393 Self::ENCODED_LEN,
25394 __tmp.remaining(),
25395 )
25396 }
25397 __tmp.put_u16_le(self.sequence);
25398 __tmp.put_u16_le(self.sequence_oldest_available);
25399 __tmp.put_u8(self.target_system);
25400 __tmp.put_u8(self.target_component);
25401 __tmp.put_u8(self.reason as u8);
25402 if matches!(version, MavlinkVersion::V2) {
25403 let len = __tmp.len();
25404 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25405 } else {
25406 __tmp.len()
25407 }
25408 }
25409}
25410#[doc = "Read out the safety zone the MAV currently assumes."]
25411#[doc = ""]
25412#[doc = "ID: 55"]
25413#[derive(Debug, Clone, PartialEq)]
25414#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25415#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25416pub struct SAFETY_ALLOWED_AREA_DATA {
25417 #[doc = "x position 1 / Latitude 1"]
25418 pub p1x: f32,
25419 #[doc = "y position 1 / Longitude 1"]
25420 pub p1y: f32,
25421 #[doc = "z position 1 / Altitude 1"]
25422 pub p1z: f32,
25423 #[doc = "x position 2 / Latitude 2"]
25424 pub p2x: f32,
25425 #[doc = "y position 2 / Longitude 2"]
25426 pub p2y: f32,
25427 #[doc = "z position 2 / Altitude 2"]
25428 pub p2z: f32,
25429 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
25430 pub frame: MavFrame,
25431}
25432impl SAFETY_ALLOWED_AREA_DATA {
25433 pub const ENCODED_LEN: usize = 25usize;
25434 pub const DEFAULT: Self = Self {
25435 p1x: 0.0_f32,
25436 p1y: 0.0_f32,
25437 p1z: 0.0_f32,
25438 p2x: 0.0_f32,
25439 p2y: 0.0_f32,
25440 p2z: 0.0_f32,
25441 frame: MavFrame::DEFAULT,
25442 };
25443 #[cfg(feature = "arbitrary")]
25444 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25445 use arbitrary::{Arbitrary, Unstructured};
25446 let mut buf = [0u8; 1024];
25447 rng.fill_bytes(&mut buf);
25448 let mut unstructured = Unstructured::new(&buf);
25449 Self::arbitrary(&mut unstructured).unwrap_or_default()
25450 }
25451}
25452impl Default for SAFETY_ALLOWED_AREA_DATA {
25453 fn default() -> Self {
25454 Self::DEFAULT.clone()
25455 }
25456}
25457impl MessageData for SAFETY_ALLOWED_AREA_DATA {
25458 type Message = MavMessage;
25459 const ID: u32 = 55u32;
25460 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
25461 const EXTRA_CRC: u8 = 3u8;
25462 const ENCODED_LEN: usize = 25usize;
25463 fn deser(
25464 _version: MavlinkVersion,
25465 __input: &[u8],
25466 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25467 let avail_len = __input.len();
25468 let mut payload_buf = [0; Self::ENCODED_LEN];
25469 let mut buf = if avail_len < Self::ENCODED_LEN {
25470 payload_buf[0..avail_len].copy_from_slice(__input);
25471 Bytes::new(&payload_buf)
25472 } else {
25473 Bytes::new(__input)
25474 };
25475 let mut __struct = Self::default();
25476 __struct.p1x = buf.get_f32_le();
25477 __struct.p1y = buf.get_f32_le();
25478 __struct.p1z = buf.get_f32_le();
25479 __struct.p2x = buf.get_f32_le();
25480 __struct.p2y = buf.get_f32_le();
25481 __struct.p2z = buf.get_f32_le();
25482 let tmp = buf.get_u8();
25483 __struct.frame =
25484 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25485 enum_type: "MavFrame",
25486 value: tmp as u32,
25487 })?;
25488 Ok(__struct)
25489 }
25490 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25491 let mut __tmp = BytesMut::new(bytes);
25492 #[allow(clippy::absurd_extreme_comparisons)]
25493 #[allow(unused_comparisons)]
25494 if __tmp.remaining() < Self::ENCODED_LEN {
25495 panic!(
25496 "buffer is too small (need {} bytes, but got {})",
25497 Self::ENCODED_LEN,
25498 __tmp.remaining(),
25499 )
25500 }
25501 __tmp.put_f32_le(self.p1x);
25502 __tmp.put_f32_le(self.p1y);
25503 __tmp.put_f32_le(self.p1z);
25504 __tmp.put_f32_le(self.p2x);
25505 __tmp.put_f32_le(self.p2y);
25506 __tmp.put_f32_le(self.p2z);
25507 __tmp.put_u8(self.frame as u8);
25508 if matches!(version, MavlinkVersion::V2) {
25509 let len = __tmp.len();
25510 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25511 } else {
25512 __tmp.len()
25513 }
25514 }
25515}
25516#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
25517#[doc = ""]
25518#[doc = "ID: 54"]
25519#[derive(Debug, Clone, PartialEq)]
25520#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25521#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25522pub struct SAFETY_SET_ALLOWED_AREA_DATA {
25523 #[doc = "x position 1 / Latitude 1"]
25524 pub p1x: f32,
25525 #[doc = "y position 1 / Longitude 1"]
25526 pub p1y: f32,
25527 #[doc = "z position 1 / Altitude 1"]
25528 pub p1z: f32,
25529 #[doc = "x position 2 / Latitude 2"]
25530 pub p2x: f32,
25531 #[doc = "y position 2 / Longitude 2"]
25532 pub p2y: f32,
25533 #[doc = "z position 2 / Altitude 2"]
25534 pub p2z: f32,
25535 #[doc = "System ID"]
25536 pub target_system: u8,
25537 #[doc = "Component ID"]
25538 pub target_component: u8,
25539 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
25540 pub frame: MavFrame,
25541}
25542impl SAFETY_SET_ALLOWED_AREA_DATA {
25543 pub const ENCODED_LEN: usize = 27usize;
25544 pub const DEFAULT: Self = Self {
25545 p1x: 0.0_f32,
25546 p1y: 0.0_f32,
25547 p1z: 0.0_f32,
25548 p2x: 0.0_f32,
25549 p2y: 0.0_f32,
25550 p2z: 0.0_f32,
25551 target_system: 0_u8,
25552 target_component: 0_u8,
25553 frame: MavFrame::DEFAULT,
25554 };
25555 #[cfg(feature = "arbitrary")]
25556 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25557 use arbitrary::{Arbitrary, Unstructured};
25558 let mut buf = [0u8; 1024];
25559 rng.fill_bytes(&mut buf);
25560 let mut unstructured = Unstructured::new(&buf);
25561 Self::arbitrary(&mut unstructured).unwrap_or_default()
25562 }
25563}
25564impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
25565 fn default() -> Self {
25566 Self::DEFAULT.clone()
25567 }
25568}
25569impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
25570 type Message = MavMessage;
25571 const ID: u32 = 54u32;
25572 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
25573 const EXTRA_CRC: u8 = 15u8;
25574 const ENCODED_LEN: usize = 27usize;
25575 fn deser(
25576 _version: MavlinkVersion,
25577 __input: &[u8],
25578 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25579 let avail_len = __input.len();
25580 let mut payload_buf = [0; Self::ENCODED_LEN];
25581 let mut buf = if avail_len < Self::ENCODED_LEN {
25582 payload_buf[0..avail_len].copy_from_slice(__input);
25583 Bytes::new(&payload_buf)
25584 } else {
25585 Bytes::new(__input)
25586 };
25587 let mut __struct = Self::default();
25588 __struct.p1x = buf.get_f32_le();
25589 __struct.p1y = buf.get_f32_le();
25590 __struct.p1z = buf.get_f32_le();
25591 __struct.p2x = buf.get_f32_le();
25592 __struct.p2y = buf.get_f32_le();
25593 __struct.p2z = buf.get_f32_le();
25594 __struct.target_system = buf.get_u8();
25595 __struct.target_component = buf.get_u8();
25596 let tmp = buf.get_u8();
25597 __struct.frame =
25598 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25599 enum_type: "MavFrame",
25600 value: tmp as u32,
25601 })?;
25602 Ok(__struct)
25603 }
25604 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25605 let mut __tmp = BytesMut::new(bytes);
25606 #[allow(clippy::absurd_extreme_comparisons)]
25607 #[allow(unused_comparisons)]
25608 if __tmp.remaining() < Self::ENCODED_LEN {
25609 panic!(
25610 "buffer is too small (need {} bytes, but got {})",
25611 Self::ENCODED_LEN,
25612 __tmp.remaining(),
25613 )
25614 }
25615 __tmp.put_f32_le(self.p1x);
25616 __tmp.put_f32_le(self.p1y);
25617 __tmp.put_f32_le(self.p1z);
25618 __tmp.put_f32_le(self.p2x);
25619 __tmp.put_f32_le(self.p2y);
25620 __tmp.put_f32_le(self.p2z);
25621 __tmp.put_u8(self.target_system);
25622 __tmp.put_u8(self.target_component);
25623 __tmp.put_u8(self.frame as u8);
25624 if matches!(version, MavlinkVersion::V2) {
25625 let len = __tmp.len();
25626 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25627 } else {
25628 __tmp.len()
25629 }
25630 }
25631}
25632#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
25633#[doc = ""]
25634#[doc = "ID: 26"]
25635#[derive(Debug, Clone, PartialEq)]
25636#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25637#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25638pub struct SCALED_IMU_DATA {
25639 #[doc = "Timestamp (time since system boot)."]
25640 pub time_boot_ms: u32,
25641 #[doc = "X acceleration"]
25642 pub xacc: i16,
25643 #[doc = "Y acceleration"]
25644 pub yacc: i16,
25645 #[doc = "Z acceleration"]
25646 pub zacc: i16,
25647 #[doc = "Angular speed around X axis"]
25648 pub xgyro: i16,
25649 #[doc = "Angular speed around Y axis"]
25650 pub ygyro: i16,
25651 #[doc = "Angular speed around Z axis"]
25652 pub zgyro: i16,
25653 #[doc = "X Magnetic field"]
25654 pub xmag: i16,
25655 #[doc = "Y Magnetic field"]
25656 pub ymag: i16,
25657 #[doc = "Z Magnetic field"]
25658 pub zmag: i16,
25659 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25660 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25661 pub temperature: i16,
25662}
25663impl SCALED_IMU_DATA {
25664 pub const ENCODED_LEN: usize = 24usize;
25665 pub const DEFAULT: Self = Self {
25666 time_boot_ms: 0_u32,
25667 xacc: 0_i16,
25668 yacc: 0_i16,
25669 zacc: 0_i16,
25670 xgyro: 0_i16,
25671 ygyro: 0_i16,
25672 zgyro: 0_i16,
25673 xmag: 0_i16,
25674 ymag: 0_i16,
25675 zmag: 0_i16,
25676 temperature: 0_i16,
25677 };
25678 #[cfg(feature = "arbitrary")]
25679 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25680 use arbitrary::{Arbitrary, Unstructured};
25681 let mut buf = [0u8; 1024];
25682 rng.fill_bytes(&mut buf);
25683 let mut unstructured = Unstructured::new(&buf);
25684 Self::arbitrary(&mut unstructured).unwrap_or_default()
25685 }
25686}
25687impl Default for SCALED_IMU_DATA {
25688 fn default() -> Self {
25689 Self::DEFAULT.clone()
25690 }
25691}
25692impl MessageData for SCALED_IMU_DATA {
25693 type Message = MavMessage;
25694 const ID: u32 = 26u32;
25695 const NAME: &'static str = "SCALED_IMU";
25696 const EXTRA_CRC: u8 = 170u8;
25697 const ENCODED_LEN: usize = 24usize;
25698 fn deser(
25699 _version: MavlinkVersion,
25700 __input: &[u8],
25701 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25702 let avail_len = __input.len();
25703 let mut payload_buf = [0; Self::ENCODED_LEN];
25704 let mut buf = if avail_len < Self::ENCODED_LEN {
25705 payload_buf[0..avail_len].copy_from_slice(__input);
25706 Bytes::new(&payload_buf)
25707 } else {
25708 Bytes::new(__input)
25709 };
25710 let mut __struct = Self::default();
25711 __struct.time_boot_ms = buf.get_u32_le();
25712 __struct.xacc = buf.get_i16_le();
25713 __struct.yacc = buf.get_i16_le();
25714 __struct.zacc = buf.get_i16_le();
25715 __struct.xgyro = buf.get_i16_le();
25716 __struct.ygyro = buf.get_i16_le();
25717 __struct.zgyro = buf.get_i16_le();
25718 __struct.xmag = buf.get_i16_le();
25719 __struct.ymag = buf.get_i16_le();
25720 __struct.zmag = buf.get_i16_le();
25721 __struct.temperature = buf.get_i16_le();
25722 Ok(__struct)
25723 }
25724 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25725 let mut __tmp = BytesMut::new(bytes);
25726 #[allow(clippy::absurd_extreme_comparisons)]
25727 #[allow(unused_comparisons)]
25728 if __tmp.remaining() < Self::ENCODED_LEN {
25729 panic!(
25730 "buffer is too small (need {} bytes, but got {})",
25731 Self::ENCODED_LEN,
25732 __tmp.remaining(),
25733 )
25734 }
25735 __tmp.put_u32_le(self.time_boot_ms);
25736 __tmp.put_i16_le(self.xacc);
25737 __tmp.put_i16_le(self.yacc);
25738 __tmp.put_i16_le(self.zacc);
25739 __tmp.put_i16_le(self.xgyro);
25740 __tmp.put_i16_le(self.ygyro);
25741 __tmp.put_i16_le(self.zgyro);
25742 __tmp.put_i16_le(self.xmag);
25743 __tmp.put_i16_le(self.ymag);
25744 __tmp.put_i16_le(self.zmag);
25745 if matches!(version, MavlinkVersion::V2) {
25746 __tmp.put_i16_le(self.temperature);
25747 let len = __tmp.len();
25748 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25749 } else {
25750 __tmp.len()
25751 }
25752 }
25753}
25754#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
25755#[doc = ""]
25756#[doc = "ID: 116"]
25757#[derive(Debug, Clone, PartialEq)]
25758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25759#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25760pub struct SCALED_IMU2_DATA {
25761 #[doc = "Timestamp (time since system boot)."]
25762 pub time_boot_ms: u32,
25763 #[doc = "X acceleration"]
25764 pub xacc: i16,
25765 #[doc = "Y acceleration"]
25766 pub yacc: i16,
25767 #[doc = "Z acceleration"]
25768 pub zacc: i16,
25769 #[doc = "Angular speed around X axis"]
25770 pub xgyro: i16,
25771 #[doc = "Angular speed around Y axis"]
25772 pub ygyro: i16,
25773 #[doc = "Angular speed around Z axis"]
25774 pub zgyro: i16,
25775 #[doc = "X Magnetic field"]
25776 pub xmag: i16,
25777 #[doc = "Y Magnetic field"]
25778 pub ymag: i16,
25779 #[doc = "Z Magnetic field"]
25780 pub zmag: i16,
25781 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25782 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25783 pub temperature: i16,
25784}
25785impl SCALED_IMU2_DATA {
25786 pub const ENCODED_LEN: usize = 24usize;
25787 pub const DEFAULT: Self = Self {
25788 time_boot_ms: 0_u32,
25789 xacc: 0_i16,
25790 yacc: 0_i16,
25791 zacc: 0_i16,
25792 xgyro: 0_i16,
25793 ygyro: 0_i16,
25794 zgyro: 0_i16,
25795 xmag: 0_i16,
25796 ymag: 0_i16,
25797 zmag: 0_i16,
25798 temperature: 0_i16,
25799 };
25800 #[cfg(feature = "arbitrary")]
25801 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25802 use arbitrary::{Arbitrary, Unstructured};
25803 let mut buf = [0u8; 1024];
25804 rng.fill_bytes(&mut buf);
25805 let mut unstructured = Unstructured::new(&buf);
25806 Self::arbitrary(&mut unstructured).unwrap_or_default()
25807 }
25808}
25809impl Default for SCALED_IMU2_DATA {
25810 fn default() -> Self {
25811 Self::DEFAULT.clone()
25812 }
25813}
25814impl MessageData for SCALED_IMU2_DATA {
25815 type Message = MavMessage;
25816 const ID: u32 = 116u32;
25817 const NAME: &'static str = "SCALED_IMU2";
25818 const EXTRA_CRC: u8 = 76u8;
25819 const ENCODED_LEN: usize = 24usize;
25820 fn deser(
25821 _version: MavlinkVersion,
25822 __input: &[u8],
25823 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25824 let avail_len = __input.len();
25825 let mut payload_buf = [0; Self::ENCODED_LEN];
25826 let mut buf = if avail_len < Self::ENCODED_LEN {
25827 payload_buf[0..avail_len].copy_from_slice(__input);
25828 Bytes::new(&payload_buf)
25829 } else {
25830 Bytes::new(__input)
25831 };
25832 let mut __struct = Self::default();
25833 __struct.time_boot_ms = buf.get_u32_le();
25834 __struct.xacc = buf.get_i16_le();
25835 __struct.yacc = buf.get_i16_le();
25836 __struct.zacc = buf.get_i16_le();
25837 __struct.xgyro = buf.get_i16_le();
25838 __struct.ygyro = buf.get_i16_le();
25839 __struct.zgyro = buf.get_i16_le();
25840 __struct.xmag = buf.get_i16_le();
25841 __struct.ymag = buf.get_i16_le();
25842 __struct.zmag = buf.get_i16_le();
25843 __struct.temperature = buf.get_i16_le();
25844 Ok(__struct)
25845 }
25846 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25847 let mut __tmp = BytesMut::new(bytes);
25848 #[allow(clippy::absurd_extreme_comparisons)]
25849 #[allow(unused_comparisons)]
25850 if __tmp.remaining() < Self::ENCODED_LEN {
25851 panic!(
25852 "buffer is too small (need {} bytes, but got {})",
25853 Self::ENCODED_LEN,
25854 __tmp.remaining(),
25855 )
25856 }
25857 __tmp.put_u32_le(self.time_boot_ms);
25858 __tmp.put_i16_le(self.xacc);
25859 __tmp.put_i16_le(self.yacc);
25860 __tmp.put_i16_le(self.zacc);
25861 __tmp.put_i16_le(self.xgyro);
25862 __tmp.put_i16_le(self.ygyro);
25863 __tmp.put_i16_le(self.zgyro);
25864 __tmp.put_i16_le(self.xmag);
25865 __tmp.put_i16_le(self.ymag);
25866 __tmp.put_i16_le(self.zmag);
25867 if matches!(version, MavlinkVersion::V2) {
25868 __tmp.put_i16_le(self.temperature);
25869 let len = __tmp.len();
25870 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25871 } else {
25872 __tmp.len()
25873 }
25874 }
25875}
25876#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
25877#[doc = ""]
25878#[doc = "ID: 129"]
25879#[derive(Debug, Clone, PartialEq)]
25880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25881#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25882pub struct SCALED_IMU3_DATA {
25883 #[doc = "Timestamp (time since system boot)."]
25884 pub time_boot_ms: u32,
25885 #[doc = "X acceleration"]
25886 pub xacc: i16,
25887 #[doc = "Y acceleration"]
25888 pub yacc: i16,
25889 #[doc = "Z acceleration"]
25890 pub zacc: i16,
25891 #[doc = "Angular speed around X axis"]
25892 pub xgyro: i16,
25893 #[doc = "Angular speed around Y axis"]
25894 pub ygyro: i16,
25895 #[doc = "Angular speed around Z axis"]
25896 pub zgyro: i16,
25897 #[doc = "X Magnetic field"]
25898 pub xmag: i16,
25899 #[doc = "Y Magnetic field"]
25900 pub ymag: i16,
25901 #[doc = "Z Magnetic field"]
25902 pub zmag: i16,
25903 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25904 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25905 pub temperature: i16,
25906}
25907impl SCALED_IMU3_DATA {
25908 pub const ENCODED_LEN: usize = 24usize;
25909 pub const DEFAULT: Self = Self {
25910 time_boot_ms: 0_u32,
25911 xacc: 0_i16,
25912 yacc: 0_i16,
25913 zacc: 0_i16,
25914 xgyro: 0_i16,
25915 ygyro: 0_i16,
25916 zgyro: 0_i16,
25917 xmag: 0_i16,
25918 ymag: 0_i16,
25919 zmag: 0_i16,
25920 temperature: 0_i16,
25921 };
25922 #[cfg(feature = "arbitrary")]
25923 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25924 use arbitrary::{Arbitrary, Unstructured};
25925 let mut buf = [0u8; 1024];
25926 rng.fill_bytes(&mut buf);
25927 let mut unstructured = Unstructured::new(&buf);
25928 Self::arbitrary(&mut unstructured).unwrap_or_default()
25929 }
25930}
25931impl Default for SCALED_IMU3_DATA {
25932 fn default() -> Self {
25933 Self::DEFAULT.clone()
25934 }
25935}
25936impl MessageData for SCALED_IMU3_DATA {
25937 type Message = MavMessage;
25938 const ID: u32 = 129u32;
25939 const NAME: &'static str = "SCALED_IMU3";
25940 const EXTRA_CRC: u8 = 46u8;
25941 const ENCODED_LEN: usize = 24usize;
25942 fn deser(
25943 _version: MavlinkVersion,
25944 __input: &[u8],
25945 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25946 let avail_len = __input.len();
25947 let mut payload_buf = [0; Self::ENCODED_LEN];
25948 let mut buf = if avail_len < Self::ENCODED_LEN {
25949 payload_buf[0..avail_len].copy_from_slice(__input);
25950 Bytes::new(&payload_buf)
25951 } else {
25952 Bytes::new(__input)
25953 };
25954 let mut __struct = Self::default();
25955 __struct.time_boot_ms = buf.get_u32_le();
25956 __struct.xacc = buf.get_i16_le();
25957 __struct.yacc = buf.get_i16_le();
25958 __struct.zacc = buf.get_i16_le();
25959 __struct.xgyro = buf.get_i16_le();
25960 __struct.ygyro = buf.get_i16_le();
25961 __struct.zgyro = buf.get_i16_le();
25962 __struct.xmag = buf.get_i16_le();
25963 __struct.ymag = buf.get_i16_le();
25964 __struct.zmag = buf.get_i16_le();
25965 __struct.temperature = buf.get_i16_le();
25966 Ok(__struct)
25967 }
25968 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25969 let mut __tmp = BytesMut::new(bytes);
25970 #[allow(clippy::absurd_extreme_comparisons)]
25971 #[allow(unused_comparisons)]
25972 if __tmp.remaining() < Self::ENCODED_LEN {
25973 panic!(
25974 "buffer is too small (need {} bytes, but got {})",
25975 Self::ENCODED_LEN,
25976 __tmp.remaining(),
25977 )
25978 }
25979 __tmp.put_u32_le(self.time_boot_ms);
25980 __tmp.put_i16_le(self.xacc);
25981 __tmp.put_i16_le(self.yacc);
25982 __tmp.put_i16_le(self.zacc);
25983 __tmp.put_i16_le(self.xgyro);
25984 __tmp.put_i16_le(self.ygyro);
25985 __tmp.put_i16_le(self.zgyro);
25986 __tmp.put_i16_le(self.xmag);
25987 __tmp.put_i16_le(self.ymag);
25988 __tmp.put_i16_le(self.zmag);
25989 if matches!(version, MavlinkVersion::V2) {
25990 __tmp.put_i16_le(self.temperature);
25991 let len = __tmp.len();
25992 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25993 } else {
25994 __tmp.len()
25995 }
25996 }
25997}
25998#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
25999#[doc = ""]
26000#[doc = "ID: 29"]
26001#[derive(Debug, Clone, PartialEq)]
26002#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26003#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26004pub struct SCALED_PRESSURE_DATA {
26005 #[doc = "Timestamp (time since system boot)."]
26006 pub time_boot_ms: u32,
26007 #[doc = "Absolute pressure"]
26008 pub press_abs: f32,
26009 #[doc = "Differential pressure 1"]
26010 pub press_diff: f32,
26011 #[doc = "Absolute pressure temperature"]
26012 pub temperature: i16,
26013 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26014 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26015 pub temperature_press_diff: i16,
26016}
26017impl SCALED_PRESSURE_DATA {
26018 pub const ENCODED_LEN: usize = 16usize;
26019 pub const DEFAULT: Self = Self {
26020 time_boot_ms: 0_u32,
26021 press_abs: 0.0_f32,
26022 press_diff: 0.0_f32,
26023 temperature: 0_i16,
26024 temperature_press_diff: 0_i16,
26025 };
26026 #[cfg(feature = "arbitrary")]
26027 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26028 use arbitrary::{Arbitrary, Unstructured};
26029 let mut buf = [0u8; 1024];
26030 rng.fill_bytes(&mut buf);
26031 let mut unstructured = Unstructured::new(&buf);
26032 Self::arbitrary(&mut unstructured).unwrap_or_default()
26033 }
26034}
26035impl Default for SCALED_PRESSURE_DATA {
26036 fn default() -> Self {
26037 Self::DEFAULT.clone()
26038 }
26039}
26040impl MessageData for SCALED_PRESSURE_DATA {
26041 type Message = MavMessage;
26042 const ID: u32 = 29u32;
26043 const NAME: &'static str = "SCALED_PRESSURE";
26044 const EXTRA_CRC: u8 = 115u8;
26045 const ENCODED_LEN: usize = 16usize;
26046 fn deser(
26047 _version: MavlinkVersion,
26048 __input: &[u8],
26049 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26050 let avail_len = __input.len();
26051 let mut payload_buf = [0; Self::ENCODED_LEN];
26052 let mut buf = if avail_len < Self::ENCODED_LEN {
26053 payload_buf[0..avail_len].copy_from_slice(__input);
26054 Bytes::new(&payload_buf)
26055 } else {
26056 Bytes::new(__input)
26057 };
26058 let mut __struct = Self::default();
26059 __struct.time_boot_ms = buf.get_u32_le();
26060 __struct.press_abs = buf.get_f32_le();
26061 __struct.press_diff = buf.get_f32_le();
26062 __struct.temperature = buf.get_i16_le();
26063 __struct.temperature_press_diff = buf.get_i16_le();
26064 Ok(__struct)
26065 }
26066 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26067 let mut __tmp = BytesMut::new(bytes);
26068 #[allow(clippy::absurd_extreme_comparisons)]
26069 #[allow(unused_comparisons)]
26070 if __tmp.remaining() < Self::ENCODED_LEN {
26071 panic!(
26072 "buffer is too small (need {} bytes, but got {})",
26073 Self::ENCODED_LEN,
26074 __tmp.remaining(),
26075 )
26076 }
26077 __tmp.put_u32_le(self.time_boot_ms);
26078 __tmp.put_f32_le(self.press_abs);
26079 __tmp.put_f32_le(self.press_diff);
26080 __tmp.put_i16_le(self.temperature);
26081 if matches!(version, MavlinkVersion::V2) {
26082 __tmp.put_i16_le(self.temperature_press_diff);
26083 let len = __tmp.len();
26084 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26085 } else {
26086 __tmp.len()
26087 }
26088 }
26089}
26090#[doc = "Barometer readings for 2nd barometer."]
26091#[doc = ""]
26092#[doc = "ID: 137"]
26093#[derive(Debug, Clone, PartialEq)]
26094#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26095#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26096pub struct SCALED_PRESSURE2_DATA {
26097 #[doc = "Timestamp (time since system boot)."]
26098 pub time_boot_ms: u32,
26099 #[doc = "Absolute pressure"]
26100 pub press_abs: f32,
26101 #[doc = "Differential pressure"]
26102 pub press_diff: f32,
26103 #[doc = "Absolute pressure temperature"]
26104 pub temperature: i16,
26105 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26106 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26107 pub temperature_press_diff: i16,
26108}
26109impl SCALED_PRESSURE2_DATA {
26110 pub const ENCODED_LEN: usize = 16usize;
26111 pub const DEFAULT: Self = Self {
26112 time_boot_ms: 0_u32,
26113 press_abs: 0.0_f32,
26114 press_diff: 0.0_f32,
26115 temperature: 0_i16,
26116 temperature_press_diff: 0_i16,
26117 };
26118 #[cfg(feature = "arbitrary")]
26119 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26120 use arbitrary::{Arbitrary, Unstructured};
26121 let mut buf = [0u8; 1024];
26122 rng.fill_bytes(&mut buf);
26123 let mut unstructured = Unstructured::new(&buf);
26124 Self::arbitrary(&mut unstructured).unwrap_or_default()
26125 }
26126}
26127impl Default for SCALED_PRESSURE2_DATA {
26128 fn default() -> Self {
26129 Self::DEFAULT.clone()
26130 }
26131}
26132impl MessageData for SCALED_PRESSURE2_DATA {
26133 type Message = MavMessage;
26134 const ID: u32 = 137u32;
26135 const NAME: &'static str = "SCALED_PRESSURE2";
26136 const EXTRA_CRC: u8 = 195u8;
26137 const ENCODED_LEN: usize = 16usize;
26138 fn deser(
26139 _version: MavlinkVersion,
26140 __input: &[u8],
26141 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26142 let avail_len = __input.len();
26143 let mut payload_buf = [0; Self::ENCODED_LEN];
26144 let mut buf = if avail_len < Self::ENCODED_LEN {
26145 payload_buf[0..avail_len].copy_from_slice(__input);
26146 Bytes::new(&payload_buf)
26147 } else {
26148 Bytes::new(__input)
26149 };
26150 let mut __struct = Self::default();
26151 __struct.time_boot_ms = buf.get_u32_le();
26152 __struct.press_abs = buf.get_f32_le();
26153 __struct.press_diff = buf.get_f32_le();
26154 __struct.temperature = buf.get_i16_le();
26155 __struct.temperature_press_diff = buf.get_i16_le();
26156 Ok(__struct)
26157 }
26158 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26159 let mut __tmp = BytesMut::new(bytes);
26160 #[allow(clippy::absurd_extreme_comparisons)]
26161 #[allow(unused_comparisons)]
26162 if __tmp.remaining() < Self::ENCODED_LEN {
26163 panic!(
26164 "buffer is too small (need {} bytes, but got {})",
26165 Self::ENCODED_LEN,
26166 __tmp.remaining(),
26167 )
26168 }
26169 __tmp.put_u32_le(self.time_boot_ms);
26170 __tmp.put_f32_le(self.press_abs);
26171 __tmp.put_f32_le(self.press_diff);
26172 __tmp.put_i16_le(self.temperature);
26173 if matches!(version, MavlinkVersion::V2) {
26174 __tmp.put_i16_le(self.temperature_press_diff);
26175 let len = __tmp.len();
26176 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26177 } else {
26178 __tmp.len()
26179 }
26180 }
26181}
26182#[doc = "Barometer readings for 3rd barometer."]
26183#[doc = ""]
26184#[doc = "ID: 143"]
26185#[derive(Debug, Clone, PartialEq)]
26186#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26187#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26188pub struct SCALED_PRESSURE3_DATA {
26189 #[doc = "Timestamp (time since system boot)."]
26190 pub time_boot_ms: u32,
26191 #[doc = "Absolute pressure"]
26192 pub press_abs: f32,
26193 #[doc = "Differential pressure"]
26194 pub press_diff: f32,
26195 #[doc = "Absolute pressure temperature"]
26196 pub temperature: i16,
26197 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26198 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26199 pub temperature_press_diff: i16,
26200}
26201impl SCALED_PRESSURE3_DATA {
26202 pub const ENCODED_LEN: usize = 16usize;
26203 pub const DEFAULT: Self = Self {
26204 time_boot_ms: 0_u32,
26205 press_abs: 0.0_f32,
26206 press_diff: 0.0_f32,
26207 temperature: 0_i16,
26208 temperature_press_diff: 0_i16,
26209 };
26210 #[cfg(feature = "arbitrary")]
26211 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26212 use arbitrary::{Arbitrary, Unstructured};
26213 let mut buf = [0u8; 1024];
26214 rng.fill_bytes(&mut buf);
26215 let mut unstructured = Unstructured::new(&buf);
26216 Self::arbitrary(&mut unstructured).unwrap_or_default()
26217 }
26218}
26219impl Default for SCALED_PRESSURE3_DATA {
26220 fn default() -> Self {
26221 Self::DEFAULT.clone()
26222 }
26223}
26224impl MessageData for SCALED_PRESSURE3_DATA {
26225 type Message = MavMessage;
26226 const ID: u32 = 143u32;
26227 const NAME: &'static str = "SCALED_PRESSURE3";
26228 const EXTRA_CRC: u8 = 131u8;
26229 const ENCODED_LEN: usize = 16usize;
26230 fn deser(
26231 _version: MavlinkVersion,
26232 __input: &[u8],
26233 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26234 let avail_len = __input.len();
26235 let mut payload_buf = [0; Self::ENCODED_LEN];
26236 let mut buf = if avail_len < Self::ENCODED_LEN {
26237 payload_buf[0..avail_len].copy_from_slice(__input);
26238 Bytes::new(&payload_buf)
26239 } else {
26240 Bytes::new(__input)
26241 };
26242 let mut __struct = Self::default();
26243 __struct.time_boot_ms = buf.get_u32_le();
26244 __struct.press_abs = buf.get_f32_le();
26245 __struct.press_diff = buf.get_f32_le();
26246 __struct.temperature = buf.get_i16_le();
26247 __struct.temperature_press_diff = buf.get_i16_le();
26248 Ok(__struct)
26249 }
26250 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26251 let mut __tmp = BytesMut::new(bytes);
26252 #[allow(clippy::absurd_extreme_comparisons)]
26253 #[allow(unused_comparisons)]
26254 if __tmp.remaining() < Self::ENCODED_LEN {
26255 panic!(
26256 "buffer is too small (need {} bytes, but got {})",
26257 Self::ENCODED_LEN,
26258 __tmp.remaining(),
26259 )
26260 }
26261 __tmp.put_u32_le(self.time_boot_ms);
26262 __tmp.put_f32_le(self.press_abs);
26263 __tmp.put_f32_le(self.press_diff);
26264 __tmp.put_i16_le(self.temperature);
26265 if matches!(version, MavlinkVersion::V2) {
26266 __tmp.put_i16_le(self.temperature_press_diff);
26267 let len = __tmp.len();
26268 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26269 } else {
26270 __tmp.len()
26271 }
26272 }
26273}
26274#[doc = "This message is emitted as response to SCRIPT_REQUEST_LIST by the MAV to get the number of mission scripts."]
26275#[doc = ""]
26276#[doc = "ID: 183"]
26277#[derive(Debug, Clone, PartialEq)]
26278#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26279#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26280pub struct SCRIPT_COUNT_DATA {
26281 #[doc = "Number of script items in the sequence"]
26282 pub count: u16,
26283 #[doc = "System ID"]
26284 pub target_system: u8,
26285 #[doc = "Component ID"]
26286 pub target_component: u8,
26287}
26288impl SCRIPT_COUNT_DATA {
26289 pub const ENCODED_LEN: usize = 4usize;
26290 pub const DEFAULT: Self = Self {
26291 count: 0_u16,
26292 target_system: 0_u8,
26293 target_component: 0_u8,
26294 };
26295 #[cfg(feature = "arbitrary")]
26296 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26297 use arbitrary::{Arbitrary, Unstructured};
26298 let mut buf = [0u8; 1024];
26299 rng.fill_bytes(&mut buf);
26300 let mut unstructured = Unstructured::new(&buf);
26301 Self::arbitrary(&mut unstructured).unwrap_or_default()
26302 }
26303}
26304impl Default for SCRIPT_COUNT_DATA {
26305 fn default() -> Self {
26306 Self::DEFAULT.clone()
26307 }
26308}
26309impl MessageData for SCRIPT_COUNT_DATA {
26310 type Message = MavMessage;
26311 const ID: u32 = 183u32;
26312 const NAME: &'static str = "SCRIPT_COUNT";
26313 const EXTRA_CRC: u8 = 186u8;
26314 const ENCODED_LEN: usize = 4usize;
26315 fn deser(
26316 _version: MavlinkVersion,
26317 __input: &[u8],
26318 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26319 let avail_len = __input.len();
26320 let mut payload_buf = [0; Self::ENCODED_LEN];
26321 let mut buf = if avail_len < Self::ENCODED_LEN {
26322 payload_buf[0..avail_len].copy_from_slice(__input);
26323 Bytes::new(&payload_buf)
26324 } else {
26325 Bytes::new(__input)
26326 };
26327 let mut __struct = Self::default();
26328 __struct.count = buf.get_u16_le();
26329 __struct.target_system = buf.get_u8();
26330 __struct.target_component = buf.get_u8();
26331 Ok(__struct)
26332 }
26333 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26334 let mut __tmp = BytesMut::new(bytes);
26335 #[allow(clippy::absurd_extreme_comparisons)]
26336 #[allow(unused_comparisons)]
26337 if __tmp.remaining() < Self::ENCODED_LEN {
26338 panic!(
26339 "buffer is too small (need {} bytes, but got {})",
26340 Self::ENCODED_LEN,
26341 __tmp.remaining(),
26342 )
26343 }
26344 __tmp.put_u16_le(self.count);
26345 __tmp.put_u8(self.target_system);
26346 __tmp.put_u8(self.target_component);
26347 if matches!(version, MavlinkVersion::V2) {
26348 let len = __tmp.len();
26349 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26350 } else {
26351 __tmp.len()
26352 }
26353 }
26354}
26355#[doc = "This message informs about the currently active SCRIPT."]
26356#[doc = ""]
26357#[doc = "ID: 184"]
26358#[derive(Debug, Clone, PartialEq)]
26359#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26360#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26361pub struct SCRIPT_CURRENT_DATA {
26362 #[doc = "Active Sequence"]
26363 pub seq: u16,
26364}
26365impl SCRIPT_CURRENT_DATA {
26366 pub const ENCODED_LEN: usize = 2usize;
26367 pub const DEFAULT: Self = Self { seq: 0_u16 };
26368 #[cfg(feature = "arbitrary")]
26369 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26370 use arbitrary::{Arbitrary, Unstructured};
26371 let mut buf = [0u8; 1024];
26372 rng.fill_bytes(&mut buf);
26373 let mut unstructured = Unstructured::new(&buf);
26374 Self::arbitrary(&mut unstructured).unwrap_or_default()
26375 }
26376}
26377impl Default for SCRIPT_CURRENT_DATA {
26378 fn default() -> Self {
26379 Self::DEFAULT.clone()
26380 }
26381}
26382impl MessageData for SCRIPT_CURRENT_DATA {
26383 type Message = MavMessage;
26384 const ID: u32 = 184u32;
26385 const NAME: &'static str = "SCRIPT_CURRENT";
26386 const EXTRA_CRC: u8 = 40u8;
26387 const ENCODED_LEN: usize = 2usize;
26388 fn deser(
26389 _version: MavlinkVersion,
26390 __input: &[u8],
26391 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26392 let avail_len = __input.len();
26393 let mut payload_buf = [0; Self::ENCODED_LEN];
26394 let mut buf = if avail_len < Self::ENCODED_LEN {
26395 payload_buf[0..avail_len].copy_from_slice(__input);
26396 Bytes::new(&payload_buf)
26397 } else {
26398 Bytes::new(__input)
26399 };
26400 let mut __struct = Self::default();
26401 __struct.seq = buf.get_u16_le();
26402 Ok(__struct)
26403 }
26404 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26405 let mut __tmp = BytesMut::new(bytes);
26406 #[allow(clippy::absurd_extreme_comparisons)]
26407 #[allow(unused_comparisons)]
26408 if __tmp.remaining() < Self::ENCODED_LEN {
26409 panic!(
26410 "buffer is too small (need {} bytes, but got {})",
26411 Self::ENCODED_LEN,
26412 __tmp.remaining(),
26413 )
26414 }
26415 __tmp.put_u16_le(self.seq);
26416 if matches!(version, MavlinkVersion::V2) {
26417 let len = __tmp.len();
26418 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26419 } else {
26420 __tmp.len()
26421 }
26422 }
26423}
26424#[doc = "Message encoding a mission script item. This message is emitted upon a request for the next script item."]
26425#[doc = ""]
26426#[doc = "ID: 180"]
26427#[derive(Debug, Clone, PartialEq)]
26428#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26429#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26430pub struct SCRIPT_ITEM_DATA {
26431 #[doc = "Sequence"]
26432 pub seq: u16,
26433 #[doc = "System ID"]
26434 pub target_system: u8,
26435 #[doc = "Component ID"]
26436 pub target_component: u8,
26437 #[doc = "The name of the mission script, NULL terminated."]
26438 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26439 pub name: [u8; 50],
26440}
26441impl SCRIPT_ITEM_DATA {
26442 pub const ENCODED_LEN: usize = 54usize;
26443 pub const DEFAULT: Self = Self {
26444 seq: 0_u16,
26445 target_system: 0_u8,
26446 target_component: 0_u8,
26447 name: [0_u8; 50usize],
26448 };
26449 #[cfg(feature = "arbitrary")]
26450 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26451 use arbitrary::{Arbitrary, Unstructured};
26452 let mut buf = [0u8; 1024];
26453 rng.fill_bytes(&mut buf);
26454 let mut unstructured = Unstructured::new(&buf);
26455 Self::arbitrary(&mut unstructured).unwrap_or_default()
26456 }
26457}
26458impl Default for SCRIPT_ITEM_DATA {
26459 fn default() -> Self {
26460 Self::DEFAULT.clone()
26461 }
26462}
26463impl MessageData for SCRIPT_ITEM_DATA {
26464 type Message = MavMessage;
26465 const ID: u32 = 180u32;
26466 const NAME: &'static str = "SCRIPT_ITEM";
26467 const EXTRA_CRC: u8 = 231u8;
26468 const ENCODED_LEN: usize = 54usize;
26469 fn deser(
26470 _version: MavlinkVersion,
26471 __input: &[u8],
26472 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26473 let avail_len = __input.len();
26474 let mut payload_buf = [0; Self::ENCODED_LEN];
26475 let mut buf = if avail_len < Self::ENCODED_LEN {
26476 payload_buf[0..avail_len].copy_from_slice(__input);
26477 Bytes::new(&payload_buf)
26478 } else {
26479 Bytes::new(__input)
26480 };
26481 let mut __struct = Self::default();
26482 __struct.seq = buf.get_u16_le();
26483 __struct.target_system = buf.get_u8();
26484 __struct.target_component = buf.get_u8();
26485 for v in &mut __struct.name {
26486 let val = buf.get_u8();
26487 *v = val;
26488 }
26489 Ok(__struct)
26490 }
26491 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26492 let mut __tmp = BytesMut::new(bytes);
26493 #[allow(clippy::absurd_extreme_comparisons)]
26494 #[allow(unused_comparisons)]
26495 if __tmp.remaining() < Self::ENCODED_LEN {
26496 panic!(
26497 "buffer is too small (need {} bytes, but got {})",
26498 Self::ENCODED_LEN,
26499 __tmp.remaining(),
26500 )
26501 }
26502 __tmp.put_u16_le(self.seq);
26503 __tmp.put_u8(self.target_system);
26504 __tmp.put_u8(self.target_component);
26505 for val in &self.name {
26506 __tmp.put_u8(*val);
26507 }
26508 if matches!(version, MavlinkVersion::V2) {
26509 let len = __tmp.len();
26510 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26511 } else {
26512 __tmp.len()
26513 }
26514 }
26515}
26516#[doc = "Request script item with the sequence number seq. The response of the system to this message should be a SCRIPT_ITEM message."]
26517#[doc = ""]
26518#[doc = "ID: 181"]
26519#[derive(Debug, Clone, PartialEq)]
26520#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26521#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26522pub struct SCRIPT_REQUEST_DATA {
26523 #[doc = "Sequence"]
26524 pub seq: u16,
26525 #[doc = "System ID"]
26526 pub target_system: u8,
26527 #[doc = "Component ID"]
26528 pub target_component: u8,
26529}
26530impl SCRIPT_REQUEST_DATA {
26531 pub const ENCODED_LEN: usize = 4usize;
26532 pub const DEFAULT: Self = Self {
26533 seq: 0_u16,
26534 target_system: 0_u8,
26535 target_component: 0_u8,
26536 };
26537 #[cfg(feature = "arbitrary")]
26538 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26539 use arbitrary::{Arbitrary, Unstructured};
26540 let mut buf = [0u8; 1024];
26541 rng.fill_bytes(&mut buf);
26542 let mut unstructured = Unstructured::new(&buf);
26543 Self::arbitrary(&mut unstructured).unwrap_or_default()
26544 }
26545}
26546impl Default for SCRIPT_REQUEST_DATA {
26547 fn default() -> Self {
26548 Self::DEFAULT.clone()
26549 }
26550}
26551impl MessageData for SCRIPT_REQUEST_DATA {
26552 type Message = MavMessage;
26553 const ID: u32 = 181u32;
26554 const NAME: &'static str = "SCRIPT_REQUEST";
26555 const EXTRA_CRC: u8 = 129u8;
26556 const ENCODED_LEN: usize = 4usize;
26557 fn deser(
26558 _version: MavlinkVersion,
26559 __input: &[u8],
26560 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26561 let avail_len = __input.len();
26562 let mut payload_buf = [0; Self::ENCODED_LEN];
26563 let mut buf = if avail_len < Self::ENCODED_LEN {
26564 payload_buf[0..avail_len].copy_from_slice(__input);
26565 Bytes::new(&payload_buf)
26566 } else {
26567 Bytes::new(__input)
26568 };
26569 let mut __struct = Self::default();
26570 __struct.seq = buf.get_u16_le();
26571 __struct.target_system = buf.get_u8();
26572 __struct.target_component = buf.get_u8();
26573 Ok(__struct)
26574 }
26575 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26576 let mut __tmp = BytesMut::new(bytes);
26577 #[allow(clippy::absurd_extreme_comparisons)]
26578 #[allow(unused_comparisons)]
26579 if __tmp.remaining() < Self::ENCODED_LEN {
26580 panic!(
26581 "buffer is too small (need {} bytes, but got {})",
26582 Self::ENCODED_LEN,
26583 __tmp.remaining(),
26584 )
26585 }
26586 __tmp.put_u16_le(self.seq);
26587 __tmp.put_u8(self.target_system);
26588 __tmp.put_u8(self.target_component);
26589 if matches!(version, MavlinkVersion::V2) {
26590 let len = __tmp.len();
26591 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26592 } else {
26593 __tmp.len()
26594 }
26595 }
26596}
26597#[doc = "Request the overall list of mission items from the system/component."]
26598#[doc = ""]
26599#[doc = "ID: 182"]
26600#[derive(Debug, Clone, PartialEq)]
26601#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26602#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26603pub struct SCRIPT_REQUEST_LIST_DATA {
26604 #[doc = "System ID"]
26605 pub target_system: u8,
26606 #[doc = "Component ID"]
26607 pub target_component: u8,
26608}
26609impl SCRIPT_REQUEST_LIST_DATA {
26610 pub const ENCODED_LEN: usize = 2usize;
26611 pub const DEFAULT: Self = Self {
26612 target_system: 0_u8,
26613 target_component: 0_u8,
26614 };
26615 #[cfg(feature = "arbitrary")]
26616 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26617 use arbitrary::{Arbitrary, Unstructured};
26618 let mut buf = [0u8; 1024];
26619 rng.fill_bytes(&mut buf);
26620 let mut unstructured = Unstructured::new(&buf);
26621 Self::arbitrary(&mut unstructured).unwrap_or_default()
26622 }
26623}
26624impl Default for SCRIPT_REQUEST_LIST_DATA {
26625 fn default() -> Self {
26626 Self::DEFAULT.clone()
26627 }
26628}
26629impl MessageData for SCRIPT_REQUEST_LIST_DATA {
26630 type Message = MavMessage;
26631 const ID: u32 = 182u32;
26632 const NAME: &'static str = "SCRIPT_REQUEST_LIST";
26633 const EXTRA_CRC: u8 = 115u8;
26634 const ENCODED_LEN: usize = 2usize;
26635 fn deser(
26636 _version: MavlinkVersion,
26637 __input: &[u8],
26638 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26639 let avail_len = __input.len();
26640 let mut payload_buf = [0; Self::ENCODED_LEN];
26641 let mut buf = if avail_len < Self::ENCODED_LEN {
26642 payload_buf[0..avail_len].copy_from_slice(__input);
26643 Bytes::new(&payload_buf)
26644 } else {
26645 Bytes::new(__input)
26646 };
26647 let mut __struct = Self::default();
26648 __struct.target_system = buf.get_u8();
26649 __struct.target_component = buf.get_u8();
26650 Ok(__struct)
26651 }
26652 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26653 let mut __tmp = BytesMut::new(bytes);
26654 #[allow(clippy::absurd_extreme_comparisons)]
26655 #[allow(unused_comparisons)]
26656 if __tmp.remaining() < Self::ENCODED_LEN {
26657 panic!(
26658 "buffer is too small (need {} bytes, but got {})",
26659 Self::ENCODED_LEN,
26660 __tmp.remaining(),
26661 )
26662 }
26663 __tmp.put_u8(self.target_system);
26664 __tmp.put_u8(self.target_component);
26665 if matches!(version, MavlinkVersion::V2) {
26666 let len = __tmp.len();
26667 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26668 } else {
26669 __tmp.len()
26670 }
26671 }
26672}
26673#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
26674#[doc = ""]
26675#[doc = "ID: 126"]
26676#[derive(Debug, Clone, PartialEq)]
26677#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26678#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26679pub struct SERIAL_CONTROL_DATA {
26680 #[doc = "Baudrate of transfer. Zero means no change."]
26681 pub baudrate: u32,
26682 #[doc = "Timeout for reply data"]
26683 pub timeout: u16,
26684 #[doc = "Serial control device type."]
26685 pub device: SerialControlDev,
26686 #[doc = "Bitmap of serial control flags."]
26687 pub flags: SerialControlFlag,
26688 #[doc = "how many bytes in this transfer"]
26689 pub count: u8,
26690 #[doc = "serial data"]
26691 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26692 pub data: [u8; 70],
26693 #[doc = "System ID"]
26694 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26695 pub target_system: u8,
26696 #[doc = "Component ID"]
26697 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26698 pub target_component: u8,
26699}
26700impl SERIAL_CONTROL_DATA {
26701 pub const ENCODED_LEN: usize = 81usize;
26702 pub const DEFAULT: Self = Self {
26703 baudrate: 0_u32,
26704 timeout: 0_u16,
26705 device: SerialControlDev::DEFAULT,
26706 flags: SerialControlFlag::DEFAULT,
26707 count: 0_u8,
26708 data: [0_u8; 70usize],
26709 target_system: 0_u8,
26710 target_component: 0_u8,
26711 };
26712 #[cfg(feature = "arbitrary")]
26713 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26714 use arbitrary::{Arbitrary, Unstructured};
26715 let mut buf = [0u8; 1024];
26716 rng.fill_bytes(&mut buf);
26717 let mut unstructured = Unstructured::new(&buf);
26718 Self::arbitrary(&mut unstructured).unwrap_or_default()
26719 }
26720}
26721impl Default for SERIAL_CONTROL_DATA {
26722 fn default() -> Self {
26723 Self::DEFAULT.clone()
26724 }
26725}
26726impl MessageData for SERIAL_CONTROL_DATA {
26727 type Message = MavMessage;
26728 const ID: u32 = 126u32;
26729 const NAME: &'static str = "SERIAL_CONTROL";
26730 const EXTRA_CRC: u8 = 220u8;
26731 const ENCODED_LEN: usize = 81usize;
26732 fn deser(
26733 _version: MavlinkVersion,
26734 __input: &[u8],
26735 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26736 let avail_len = __input.len();
26737 let mut payload_buf = [0; Self::ENCODED_LEN];
26738 let mut buf = if avail_len < Self::ENCODED_LEN {
26739 payload_buf[0..avail_len].copy_from_slice(__input);
26740 Bytes::new(&payload_buf)
26741 } else {
26742 Bytes::new(__input)
26743 };
26744 let mut __struct = Self::default();
26745 __struct.baudrate = buf.get_u32_le();
26746 __struct.timeout = buf.get_u16_le();
26747 let tmp = buf.get_u8();
26748 __struct.device =
26749 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26750 enum_type: "SerialControlDev",
26751 value: tmp as u32,
26752 })?;
26753 let tmp = buf.get_u8();
26754 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
26755 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
26756 flag_type: "SerialControlFlag",
26757 value: tmp as u32,
26758 })?;
26759 __struct.count = buf.get_u8();
26760 for v in &mut __struct.data {
26761 let val = buf.get_u8();
26762 *v = val;
26763 }
26764 __struct.target_system = buf.get_u8();
26765 __struct.target_component = buf.get_u8();
26766 Ok(__struct)
26767 }
26768 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26769 let mut __tmp = BytesMut::new(bytes);
26770 #[allow(clippy::absurd_extreme_comparisons)]
26771 #[allow(unused_comparisons)]
26772 if __tmp.remaining() < Self::ENCODED_LEN {
26773 panic!(
26774 "buffer is too small (need {} bytes, but got {})",
26775 Self::ENCODED_LEN,
26776 __tmp.remaining(),
26777 )
26778 }
26779 __tmp.put_u32_le(self.baudrate);
26780 __tmp.put_u16_le(self.timeout);
26781 __tmp.put_u8(self.device as u8);
26782 __tmp.put_u8(self.flags.bits());
26783 __tmp.put_u8(self.count);
26784 for val in &self.data {
26785 __tmp.put_u8(*val);
26786 }
26787 if matches!(version, MavlinkVersion::V2) {
26788 __tmp.put_u8(self.target_system);
26789 __tmp.put_u8(self.target_component);
26790 let len = __tmp.len();
26791 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26792 } else {
26793 __tmp.len()
26794 }
26795 }
26796}
26797#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
26798#[doc = ""]
26799#[doc = "ID: 36"]
26800#[derive(Debug, Clone, PartialEq)]
26801#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26802#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26803pub struct SERVO_OUTPUT_RAW_DATA {
26804 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26805 pub time_usec: u32,
26806 #[doc = "Servo output 1 value"]
26807 pub servo1_raw: u16,
26808 #[doc = "Servo output 2 value"]
26809 pub servo2_raw: u16,
26810 #[doc = "Servo output 3 value"]
26811 pub servo3_raw: u16,
26812 #[doc = "Servo output 4 value"]
26813 pub servo4_raw: u16,
26814 #[doc = "Servo output 5 value"]
26815 pub servo5_raw: u16,
26816 #[doc = "Servo output 6 value"]
26817 pub servo6_raw: u16,
26818 #[doc = "Servo output 7 value"]
26819 pub servo7_raw: u16,
26820 #[doc = "Servo output 8 value"]
26821 pub servo8_raw: u16,
26822 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26823 pub port: u8,
26824 #[doc = "Servo output 9 value"]
26825 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26826 pub servo9_raw: u16,
26827 #[doc = "Servo output 10 value"]
26828 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26829 pub servo10_raw: u16,
26830 #[doc = "Servo output 11 value"]
26831 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26832 pub servo11_raw: u16,
26833 #[doc = "Servo output 12 value"]
26834 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26835 pub servo12_raw: u16,
26836 #[doc = "Servo output 13 value"]
26837 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26838 pub servo13_raw: u16,
26839 #[doc = "Servo output 14 value"]
26840 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26841 pub servo14_raw: u16,
26842 #[doc = "Servo output 15 value"]
26843 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26844 pub servo15_raw: u16,
26845 #[doc = "Servo output 16 value"]
26846 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26847 pub servo16_raw: u16,
26848}
26849impl SERVO_OUTPUT_RAW_DATA {
26850 pub const ENCODED_LEN: usize = 37usize;
26851 pub const DEFAULT: Self = Self {
26852 time_usec: 0_u32,
26853 servo1_raw: 0_u16,
26854 servo2_raw: 0_u16,
26855 servo3_raw: 0_u16,
26856 servo4_raw: 0_u16,
26857 servo5_raw: 0_u16,
26858 servo6_raw: 0_u16,
26859 servo7_raw: 0_u16,
26860 servo8_raw: 0_u16,
26861 port: 0_u8,
26862 servo9_raw: 0_u16,
26863 servo10_raw: 0_u16,
26864 servo11_raw: 0_u16,
26865 servo12_raw: 0_u16,
26866 servo13_raw: 0_u16,
26867 servo14_raw: 0_u16,
26868 servo15_raw: 0_u16,
26869 servo16_raw: 0_u16,
26870 };
26871 #[cfg(feature = "arbitrary")]
26872 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26873 use arbitrary::{Arbitrary, Unstructured};
26874 let mut buf = [0u8; 1024];
26875 rng.fill_bytes(&mut buf);
26876 let mut unstructured = Unstructured::new(&buf);
26877 Self::arbitrary(&mut unstructured).unwrap_or_default()
26878 }
26879}
26880impl Default for SERVO_OUTPUT_RAW_DATA {
26881 fn default() -> Self {
26882 Self::DEFAULT.clone()
26883 }
26884}
26885impl MessageData for SERVO_OUTPUT_RAW_DATA {
26886 type Message = MavMessage;
26887 const ID: u32 = 36u32;
26888 const NAME: &'static str = "SERVO_OUTPUT_RAW";
26889 const EXTRA_CRC: u8 = 222u8;
26890 const ENCODED_LEN: usize = 37usize;
26891 fn deser(
26892 _version: MavlinkVersion,
26893 __input: &[u8],
26894 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26895 let avail_len = __input.len();
26896 let mut payload_buf = [0; Self::ENCODED_LEN];
26897 let mut buf = if avail_len < Self::ENCODED_LEN {
26898 payload_buf[0..avail_len].copy_from_slice(__input);
26899 Bytes::new(&payload_buf)
26900 } else {
26901 Bytes::new(__input)
26902 };
26903 let mut __struct = Self::default();
26904 __struct.time_usec = buf.get_u32_le();
26905 __struct.servo1_raw = buf.get_u16_le();
26906 __struct.servo2_raw = buf.get_u16_le();
26907 __struct.servo3_raw = buf.get_u16_le();
26908 __struct.servo4_raw = buf.get_u16_le();
26909 __struct.servo5_raw = buf.get_u16_le();
26910 __struct.servo6_raw = buf.get_u16_le();
26911 __struct.servo7_raw = buf.get_u16_le();
26912 __struct.servo8_raw = buf.get_u16_le();
26913 __struct.port = buf.get_u8();
26914 __struct.servo9_raw = buf.get_u16_le();
26915 __struct.servo10_raw = buf.get_u16_le();
26916 __struct.servo11_raw = buf.get_u16_le();
26917 __struct.servo12_raw = buf.get_u16_le();
26918 __struct.servo13_raw = buf.get_u16_le();
26919 __struct.servo14_raw = buf.get_u16_le();
26920 __struct.servo15_raw = buf.get_u16_le();
26921 __struct.servo16_raw = buf.get_u16_le();
26922 Ok(__struct)
26923 }
26924 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26925 let mut __tmp = BytesMut::new(bytes);
26926 #[allow(clippy::absurd_extreme_comparisons)]
26927 #[allow(unused_comparisons)]
26928 if __tmp.remaining() < Self::ENCODED_LEN {
26929 panic!(
26930 "buffer is too small (need {} bytes, but got {})",
26931 Self::ENCODED_LEN,
26932 __tmp.remaining(),
26933 )
26934 }
26935 __tmp.put_u32_le(self.time_usec);
26936 __tmp.put_u16_le(self.servo1_raw);
26937 __tmp.put_u16_le(self.servo2_raw);
26938 __tmp.put_u16_le(self.servo3_raw);
26939 __tmp.put_u16_le(self.servo4_raw);
26940 __tmp.put_u16_le(self.servo5_raw);
26941 __tmp.put_u16_le(self.servo6_raw);
26942 __tmp.put_u16_le(self.servo7_raw);
26943 __tmp.put_u16_le(self.servo8_raw);
26944 __tmp.put_u8(self.port);
26945 if matches!(version, MavlinkVersion::V2) {
26946 __tmp.put_u16_le(self.servo9_raw);
26947 __tmp.put_u16_le(self.servo10_raw);
26948 __tmp.put_u16_le(self.servo11_raw);
26949 __tmp.put_u16_le(self.servo12_raw);
26950 __tmp.put_u16_le(self.servo13_raw);
26951 __tmp.put_u16_le(self.servo14_raw);
26952 __tmp.put_u16_le(self.servo15_raw);
26953 __tmp.put_u16_le(self.servo16_raw);
26954 let len = __tmp.len();
26955 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26956 } else {
26957 __tmp.len()
26958 }
26959 }
26960}
26961#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
26962#[doc = ""]
26963#[doc = "ID: 256"]
26964#[derive(Debug, Clone, PartialEq)]
26965#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26966#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26967pub struct SETUP_SIGNING_DATA {
26968 #[doc = "initial timestamp"]
26969 pub initial_timestamp: u64,
26970 #[doc = "system id of the target"]
26971 pub target_system: u8,
26972 #[doc = "component ID of the target"]
26973 pub target_component: u8,
26974 #[doc = "signing key"]
26975 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26976 pub secret_key: [u8; 32],
26977}
26978impl SETUP_SIGNING_DATA {
26979 pub const ENCODED_LEN: usize = 42usize;
26980 pub const DEFAULT: Self = Self {
26981 initial_timestamp: 0_u64,
26982 target_system: 0_u8,
26983 target_component: 0_u8,
26984 secret_key: [0_u8; 32usize],
26985 };
26986 #[cfg(feature = "arbitrary")]
26987 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26988 use arbitrary::{Arbitrary, Unstructured};
26989 let mut buf = [0u8; 1024];
26990 rng.fill_bytes(&mut buf);
26991 let mut unstructured = Unstructured::new(&buf);
26992 Self::arbitrary(&mut unstructured).unwrap_or_default()
26993 }
26994}
26995impl Default for SETUP_SIGNING_DATA {
26996 fn default() -> Self {
26997 Self::DEFAULT.clone()
26998 }
26999}
27000impl MessageData for SETUP_SIGNING_DATA {
27001 type Message = MavMessage;
27002 const ID: u32 = 256u32;
27003 const NAME: &'static str = "SETUP_SIGNING";
27004 const EXTRA_CRC: u8 = 71u8;
27005 const ENCODED_LEN: usize = 42usize;
27006 fn deser(
27007 _version: MavlinkVersion,
27008 __input: &[u8],
27009 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27010 let avail_len = __input.len();
27011 let mut payload_buf = [0; Self::ENCODED_LEN];
27012 let mut buf = if avail_len < Self::ENCODED_LEN {
27013 payload_buf[0..avail_len].copy_from_slice(__input);
27014 Bytes::new(&payload_buf)
27015 } else {
27016 Bytes::new(__input)
27017 };
27018 let mut __struct = Self::default();
27019 __struct.initial_timestamp = buf.get_u64_le();
27020 __struct.target_system = buf.get_u8();
27021 __struct.target_component = buf.get_u8();
27022 for v in &mut __struct.secret_key {
27023 let val = buf.get_u8();
27024 *v = val;
27025 }
27026 Ok(__struct)
27027 }
27028 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27029 let mut __tmp = BytesMut::new(bytes);
27030 #[allow(clippy::absurd_extreme_comparisons)]
27031 #[allow(unused_comparisons)]
27032 if __tmp.remaining() < Self::ENCODED_LEN {
27033 panic!(
27034 "buffer is too small (need {} bytes, but got {})",
27035 Self::ENCODED_LEN,
27036 __tmp.remaining(),
27037 )
27038 }
27039 __tmp.put_u64_le(self.initial_timestamp);
27040 __tmp.put_u8(self.target_system);
27041 __tmp.put_u8(self.target_component);
27042 for val in &self.secret_key {
27043 __tmp.put_u8(*val);
27044 }
27045 if matches!(version, MavlinkVersion::V2) {
27046 let len = __tmp.len();
27047 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27048 } else {
27049 __tmp.len()
27050 }
27051 }
27052}
27053#[doc = "Set the vehicle attitude and body angular rates."]
27054#[doc = ""]
27055#[doc = "ID: 139"]
27056#[derive(Debug, Clone, PartialEq)]
27057#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27058#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27059pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
27060 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27061 pub time_usec: u64,
27062 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
27063 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27064 pub controls: [f32; 8],
27065 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
27066 pub group_mlx: u8,
27067 #[doc = "System ID"]
27068 pub target_system: u8,
27069 #[doc = "Component ID"]
27070 pub target_component: u8,
27071}
27072impl SET_ACTUATOR_CONTROL_TARGET_DATA {
27073 pub const ENCODED_LEN: usize = 43usize;
27074 pub const DEFAULT: Self = Self {
27075 time_usec: 0_u64,
27076 controls: [0.0_f32; 8usize],
27077 group_mlx: 0_u8,
27078 target_system: 0_u8,
27079 target_component: 0_u8,
27080 };
27081 #[cfg(feature = "arbitrary")]
27082 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27083 use arbitrary::{Arbitrary, Unstructured};
27084 let mut buf = [0u8; 1024];
27085 rng.fill_bytes(&mut buf);
27086 let mut unstructured = Unstructured::new(&buf);
27087 Self::arbitrary(&mut unstructured).unwrap_or_default()
27088 }
27089}
27090impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
27091 fn default() -> Self {
27092 Self::DEFAULT.clone()
27093 }
27094}
27095impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
27096 type Message = MavMessage;
27097 const ID: u32 = 139u32;
27098 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
27099 const EXTRA_CRC: u8 = 168u8;
27100 const ENCODED_LEN: usize = 43usize;
27101 fn deser(
27102 _version: MavlinkVersion,
27103 __input: &[u8],
27104 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27105 let avail_len = __input.len();
27106 let mut payload_buf = [0; Self::ENCODED_LEN];
27107 let mut buf = if avail_len < Self::ENCODED_LEN {
27108 payload_buf[0..avail_len].copy_from_slice(__input);
27109 Bytes::new(&payload_buf)
27110 } else {
27111 Bytes::new(__input)
27112 };
27113 let mut __struct = Self::default();
27114 __struct.time_usec = buf.get_u64_le();
27115 for v in &mut __struct.controls {
27116 let val = buf.get_f32_le();
27117 *v = val;
27118 }
27119 __struct.group_mlx = buf.get_u8();
27120 __struct.target_system = buf.get_u8();
27121 __struct.target_component = buf.get_u8();
27122 Ok(__struct)
27123 }
27124 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27125 let mut __tmp = BytesMut::new(bytes);
27126 #[allow(clippy::absurd_extreme_comparisons)]
27127 #[allow(unused_comparisons)]
27128 if __tmp.remaining() < Self::ENCODED_LEN {
27129 panic!(
27130 "buffer is too small (need {} bytes, but got {})",
27131 Self::ENCODED_LEN,
27132 __tmp.remaining(),
27133 )
27134 }
27135 __tmp.put_u64_le(self.time_usec);
27136 for val in &self.controls {
27137 __tmp.put_f32_le(*val);
27138 }
27139 __tmp.put_u8(self.group_mlx);
27140 __tmp.put_u8(self.target_system);
27141 __tmp.put_u8(self.target_component);
27142 if matches!(version, MavlinkVersion::V2) {
27143 let len = __tmp.len();
27144 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27145 } else {
27146 __tmp.len()
27147 }
27148 }
27149}
27150#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
27151#[doc = ""]
27152#[doc = "ID: 82"]
27153#[derive(Debug, Clone, PartialEq)]
27154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27155#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27156pub struct SET_ATTITUDE_TARGET_DATA {
27157 #[doc = "Timestamp (time since system boot)."]
27158 pub time_boot_ms: u32,
27159 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
27160 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27161 pub q: [f32; 4],
27162 #[doc = "Body roll rate"]
27163 pub body_roll_rate: f32,
27164 #[doc = "Body pitch rate"]
27165 pub body_pitch_rate: f32,
27166 #[doc = "Body yaw rate"]
27167 pub body_yaw_rate: f32,
27168 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
27169 pub thrust: f32,
27170 #[doc = "System ID"]
27171 pub target_system: u8,
27172 #[doc = "Component ID"]
27173 pub target_component: u8,
27174 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27175 pub type_mask: AttitudeTargetTypemask,
27176 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
27177 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27178 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27179 pub thrust_body: [f32; 3],
27180}
27181impl SET_ATTITUDE_TARGET_DATA {
27182 pub const ENCODED_LEN: usize = 51usize;
27183 pub const DEFAULT: Self = Self {
27184 time_boot_ms: 0_u32,
27185 q: [0.0_f32; 4usize],
27186 body_roll_rate: 0.0_f32,
27187 body_pitch_rate: 0.0_f32,
27188 body_yaw_rate: 0.0_f32,
27189 thrust: 0.0_f32,
27190 target_system: 0_u8,
27191 target_component: 0_u8,
27192 type_mask: AttitudeTargetTypemask::DEFAULT,
27193 thrust_body: [0.0_f32; 3usize],
27194 };
27195 #[cfg(feature = "arbitrary")]
27196 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27197 use arbitrary::{Arbitrary, Unstructured};
27198 let mut buf = [0u8; 1024];
27199 rng.fill_bytes(&mut buf);
27200 let mut unstructured = Unstructured::new(&buf);
27201 Self::arbitrary(&mut unstructured).unwrap_or_default()
27202 }
27203}
27204impl Default for SET_ATTITUDE_TARGET_DATA {
27205 fn default() -> Self {
27206 Self::DEFAULT.clone()
27207 }
27208}
27209impl MessageData for SET_ATTITUDE_TARGET_DATA {
27210 type Message = MavMessage;
27211 const ID: u32 = 82u32;
27212 const NAME: &'static str = "SET_ATTITUDE_TARGET";
27213 const EXTRA_CRC: u8 = 49u8;
27214 const ENCODED_LEN: usize = 51usize;
27215 fn deser(
27216 _version: MavlinkVersion,
27217 __input: &[u8],
27218 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27219 let avail_len = __input.len();
27220 let mut payload_buf = [0; Self::ENCODED_LEN];
27221 let mut buf = if avail_len < Self::ENCODED_LEN {
27222 payload_buf[0..avail_len].copy_from_slice(__input);
27223 Bytes::new(&payload_buf)
27224 } else {
27225 Bytes::new(__input)
27226 };
27227 let mut __struct = Self::default();
27228 __struct.time_boot_ms = buf.get_u32_le();
27229 for v in &mut __struct.q {
27230 let val = buf.get_f32_le();
27231 *v = val;
27232 }
27233 __struct.body_roll_rate = buf.get_f32_le();
27234 __struct.body_pitch_rate = buf.get_f32_le();
27235 __struct.body_yaw_rate = buf.get_f32_le();
27236 __struct.thrust = buf.get_f32_le();
27237 __struct.target_system = buf.get_u8();
27238 __struct.target_component = buf.get_u8();
27239 let tmp = buf.get_u8();
27240 __struct.type_mask = AttitudeTargetTypemask::from_bits(
27241 tmp & AttitudeTargetTypemask::all().bits(),
27242 )
27243 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27244 flag_type: "AttitudeTargetTypemask",
27245 value: tmp as u32,
27246 })?;
27247 for v in &mut __struct.thrust_body {
27248 let val = buf.get_f32_le();
27249 *v = val;
27250 }
27251 Ok(__struct)
27252 }
27253 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27254 let mut __tmp = BytesMut::new(bytes);
27255 #[allow(clippy::absurd_extreme_comparisons)]
27256 #[allow(unused_comparisons)]
27257 if __tmp.remaining() < Self::ENCODED_LEN {
27258 panic!(
27259 "buffer is too small (need {} bytes, but got {})",
27260 Self::ENCODED_LEN,
27261 __tmp.remaining(),
27262 )
27263 }
27264 __tmp.put_u32_le(self.time_boot_ms);
27265 for val in &self.q {
27266 __tmp.put_f32_le(*val);
27267 }
27268 __tmp.put_f32_le(self.body_roll_rate);
27269 __tmp.put_f32_le(self.body_pitch_rate);
27270 __tmp.put_f32_le(self.body_yaw_rate);
27271 __tmp.put_f32_le(self.thrust);
27272 __tmp.put_u8(self.target_system);
27273 __tmp.put_u8(self.target_component);
27274 __tmp.put_u8(self.type_mask.bits());
27275 if matches!(version, MavlinkVersion::V2) {
27276 for val in &self.thrust_body {
27277 __tmp.put_f32_le(*val);
27278 }
27279 let len = __tmp.len();
27280 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27281 } else {
27282 __tmp.len()
27283 }
27284 }
27285}
27286#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
27287#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
27288#[doc = ""]
27289#[doc = "ID: 48"]
27290#[derive(Debug, Clone, PartialEq)]
27291#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27292#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27293pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
27294 #[doc = "Latitude (WGS84)"]
27295 pub latitude: i32,
27296 #[doc = "Longitude (WGS84)"]
27297 pub longitude: i32,
27298 #[doc = "Altitude (MSL). Positive for up."]
27299 pub altitude: i32,
27300 #[doc = "System ID"]
27301 pub target_system: u8,
27302 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27303 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27304 pub time_usec: u64,
27305}
27306impl SET_GPS_GLOBAL_ORIGIN_DATA {
27307 pub const ENCODED_LEN: usize = 21usize;
27308 pub const DEFAULT: Self = Self {
27309 latitude: 0_i32,
27310 longitude: 0_i32,
27311 altitude: 0_i32,
27312 target_system: 0_u8,
27313 time_usec: 0_u64,
27314 };
27315 #[cfg(feature = "arbitrary")]
27316 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27317 use arbitrary::{Arbitrary, Unstructured};
27318 let mut buf = [0u8; 1024];
27319 rng.fill_bytes(&mut buf);
27320 let mut unstructured = Unstructured::new(&buf);
27321 Self::arbitrary(&mut unstructured).unwrap_or_default()
27322 }
27323}
27324impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
27325 fn default() -> Self {
27326 Self::DEFAULT.clone()
27327 }
27328}
27329impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
27330 type Message = MavMessage;
27331 const ID: u32 = 48u32;
27332 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
27333 const EXTRA_CRC: u8 = 41u8;
27334 const ENCODED_LEN: usize = 21usize;
27335 fn deser(
27336 _version: MavlinkVersion,
27337 __input: &[u8],
27338 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27339 let avail_len = __input.len();
27340 let mut payload_buf = [0; Self::ENCODED_LEN];
27341 let mut buf = if avail_len < Self::ENCODED_LEN {
27342 payload_buf[0..avail_len].copy_from_slice(__input);
27343 Bytes::new(&payload_buf)
27344 } else {
27345 Bytes::new(__input)
27346 };
27347 let mut __struct = Self::default();
27348 __struct.latitude = buf.get_i32_le();
27349 __struct.longitude = buf.get_i32_le();
27350 __struct.altitude = buf.get_i32_le();
27351 __struct.target_system = buf.get_u8();
27352 __struct.time_usec = buf.get_u64_le();
27353 Ok(__struct)
27354 }
27355 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27356 let mut __tmp = BytesMut::new(bytes);
27357 #[allow(clippy::absurd_extreme_comparisons)]
27358 #[allow(unused_comparisons)]
27359 if __tmp.remaining() < Self::ENCODED_LEN {
27360 panic!(
27361 "buffer is too small (need {} bytes, but got {})",
27362 Self::ENCODED_LEN,
27363 __tmp.remaining(),
27364 )
27365 }
27366 __tmp.put_i32_le(self.latitude);
27367 __tmp.put_i32_le(self.longitude);
27368 __tmp.put_i32_le(self.altitude);
27369 __tmp.put_u8(self.target_system);
27370 if matches!(version, MavlinkVersion::V2) {
27371 __tmp.put_u64_le(self.time_usec);
27372 let len = __tmp.len();
27373 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27374 } else {
27375 __tmp.len()
27376 }
27377 }
27378}
27379#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
27380#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
27381#[doc = ""]
27382#[doc = "ID: 243"]
27383#[derive(Debug, Clone, PartialEq)]
27384#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27385#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27386pub struct SET_HOME_POSITION_DATA {
27387 #[doc = "Latitude (WGS84)"]
27388 pub latitude: i32,
27389 #[doc = "Longitude (WGS84)"]
27390 pub longitude: i32,
27391 #[doc = "Altitude (MSL). Positive for up."]
27392 pub altitude: i32,
27393 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
27394 pub x: f32,
27395 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
27396 pub y: f32,
27397 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
27398 pub z: f32,
27399 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
27400 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27401 pub q: [f32; 4],
27402 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27403 pub approach_x: f32,
27404 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27405 pub approach_y: f32,
27406 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27407 pub approach_z: f32,
27408 #[doc = "System ID."]
27409 pub target_system: u8,
27410 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27411 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27412 pub time_usec: u64,
27413}
27414impl SET_HOME_POSITION_DATA {
27415 pub const ENCODED_LEN: usize = 61usize;
27416 pub const DEFAULT: Self = Self {
27417 latitude: 0_i32,
27418 longitude: 0_i32,
27419 altitude: 0_i32,
27420 x: 0.0_f32,
27421 y: 0.0_f32,
27422 z: 0.0_f32,
27423 q: [0.0_f32; 4usize],
27424 approach_x: 0.0_f32,
27425 approach_y: 0.0_f32,
27426 approach_z: 0.0_f32,
27427 target_system: 0_u8,
27428 time_usec: 0_u64,
27429 };
27430 #[cfg(feature = "arbitrary")]
27431 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27432 use arbitrary::{Arbitrary, Unstructured};
27433 let mut buf = [0u8; 1024];
27434 rng.fill_bytes(&mut buf);
27435 let mut unstructured = Unstructured::new(&buf);
27436 Self::arbitrary(&mut unstructured).unwrap_or_default()
27437 }
27438}
27439impl Default for SET_HOME_POSITION_DATA {
27440 fn default() -> Self {
27441 Self::DEFAULT.clone()
27442 }
27443}
27444impl MessageData for SET_HOME_POSITION_DATA {
27445 type Message = MavMessage;
27446 const ID: u32 = 243u32;
27447 const NAME: &'static str = "SET_HOME_POSITION";
27448 const EXTRA_CRC: u8 = 85u8;
27449 const ENCODED_LEN: usize = 61usize;
27450 fn deser(
27451 _version: MavlinkVersion,
27452 __input: &[u8],
27453 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27454 let avail_len = __input.len();
27455 let mut payload_buf = [0; Self::ENCODED_LEN];
27456 let mut buf = if avail_len < Self::ENCODED_LEN {
27457 payload_buf[0..avail_len].copy_from_slice(__input);
27458 Bytes::new(&payload_buf)
27459 } else {
27460 Bytes::new(__input)
27461 };
27462 let mut __struct = Self::default();
27463 __struct.latitude = buf.get_i32_le();
27464 __struct.longitude = buf.get_i32_le();
27465 __struct.altitude = buf.get_i32_le();
27466 __struct.x = buf.get_f32_le();
27467 __struct.y = buf.get_f32_le();
27468 __struct.z = buf.get_f32_le();
27469 for v in &mut __struct.q {
27470 let val = buf.get_f32_le();
27471 *v = val;
27472 }
27473 __struct.approach_x = buf.get_f32_le();
27474 __struct.approach_y = buf.get_f32_le();
27475 __struct.approach_z = buf.get_f32_le();
27476 __struct.target_system = buf.get_u8();
27477 __struct.time_usec = buf.get_u64_le();
27478 Ok(__struct)
27479 }
27480 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27481 let mut __tmp = BytesMut::new(bytes);
27482 #[allow(clippy::absurd_extreme_comparisons)]
27483 #[allow(unused_comparisons)]
27484 if __tmp.remaining() < Self::ENCODED_LEN {
27485 panic!(
27486 "buffer is too small (need {} bytes, but got {})",
27487 Self::ENCODED_LEN,
27488 __tmp.remaining(),
27489 )
27490 }
27491 __tmp.put_i32_le(self.latitude);
27492 __tmp.put_i32_le(self.longitude);
27493 __tmp.put_i32_le(self.altitude);
27494 __tmp.put_f32_le(self.x);
27495 __tmp.put_f32_le(self.y);
27496 __tmp.put_f32_le(self.z);
27497 for val in &self.q {
27498 __tmp.put_f32_le(*val);
27499 }
27500 __tmp.put_f32_le(self.approach_x);
27501 __tmp.put_f32_le(self.approach_y);
27502 __tmp.put_f32_le(self.approach_z);
27503 __tmp.put_u8(self.target_system);
27504 if matches!(version, MavlinkVersion::V2) {
27505 __tmp.put_u64_le(self.time_usec);
27506 let len = __tmp.len();
27507 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27508 } else {
27509 __tmp.len()
27510 }
27511 }
27512}
27513#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
27514#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
27515#[doc = ""]
27516#[doc = "ID: 11"]
27517#[derive(Debug, Clone, PartialEq)]
27518#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27519#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27520pub struct SET_MODE_DATA {
27521 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
27522 pub custom_mode: u32,
27523 #[doc = "The system setting the mode"]
27524 pub target_system: u8,
27525 #[doc = "The new base mode."]
27526 pub base_mode: MavMode,
27527}
27528impl SET_MODE_DATA {
27529 pub const ENCODED_LEN: usize = 6usize;
27530 pub const DEFAULT: Self = Self {
27531 custom_mode: 0_u32,
27532 target_system: 0_u8,
27533 base_mode: MavMode::DEFAULT,
27534 };
27535 #[cfg(feature = "arbitrary")]
27536 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27537 use arbitrary::{Arbitrary, Unstructured};
27538 let mut buf = [0u8; 1024];
27539 rng.fill_bytes(&mut buf);
27540 let mut unstructured = Unstructured::new(&buf);
27541 Self::arbitrary(&mut unstructured).unwrap_or_default()
27542 }
27543}
27544impl Default for SET_MODE_DATA {
27545 fn default() -> Self {
27546 Self::DEFAULT.clone()
27547 }
27548}
27549impl MessageData for SET_MODE_DATA {
27550 type Message = MavMessage;
27551 const ID: u32 = 11u32;
27552 const NAME: &'static str = "SET_MODE";
27553 const EXTRA_CRC: u8 = 89u8;
27554 const ENCODED_LEN: usize = 6usize;
27555 fn deser(
27556 _version: MavlinkVersion,
27557 __input: &[u8],
27558 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27559 let avail_len = __input.len();
27560 let mut payload_buf = [0; Self::ENCODED_LEN];
27561 let mut buf = if avail_len < Self::ENCODED_LEN {
27562 payload_buf[0..avail_len].copy_from_slice(__input);
27563 Bytes::new(&payload_buf)
27564 } else {
27565 Bytes::new(__input)
27566 };
27567 let mut __struct = Self::default();
27568 __struct.custom_mode = buf.get_u32_le();
27569 __struct.target_system = buf.get_u8();
27570 let tmp = buf.get_u8();
27571 __struct.base_mode =
27572 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27573 enum_type: "MavMode",
27574 value: tmp as u32,
27575 })?;
27576 Ok(__struct)
27577 }
27578 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27579 let mut __tmp = BytesMut::new(bytes);
27580 #[allow(clippy::absurd_extreme_comparisons)]
27581 #[allow(unused_comparisons)]
27582 if __tmp.remaining() < Self::ENCODED_LEN {
27583 panic!(
27584 "buffer is too small (need {} bytes, but got {})",
27585 Self::ENCODED_LEN,
27586 __tmp.remaining(),
27587 )
27588 }
27589 __tmp.put_u32_le(self.custom_mode);
27590 __tmp.put_u8(self.target_system);
27591 __tmp.put_u8(self.base_mode as u8);
27592 if matches!(version, MavlinkVersion::V2) {
27593 let len = __tmp.len();
27594 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27595 } else {
27596 __tmp.len()
27597 }
27598 }
27599}
27600#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
27601#[doc = ""]
27602#[doc = "ID: 86"]
27603#[derive(Debug, Clone, PartialEq)]
27604#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27605#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27606pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
27607 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
27608 pub time_boot_ms: u32,
27609 #[doc = "Latitude in WGS84 frame"]
27610 pub lat_int: i32,
27611 #[doc = "Longitude in WGS84 frame"]
27612 pub lon_int: i32,
27613 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
27614 pub alt: f32,
27615 #[doc = "X velocity in NED frame"]
27616 pub vx: f32,
27617 #[doc = "Y velocity in NED frame"]
27618 pub vy: f32,
27619 #[doc = "Z velocity in NED frame"]
27620 pub vz: f32,
27621 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27622 pub afx: f32,
27623 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27624 pub afy: f32,
27625 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27626 pub afz: f32,
27627 #[doc = "yaw setpoint"]
27628 pub yaw: f32,
27629 #[doc = "yaw rate setpoint"]
27630 pub yaw_rate: f32,
27631 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27632 pub type_mask: PositionTargetTypemask,
27633 #[doc = "System ID"]
27634 pub target_system: u8,
27635 #[doc = "Component ID"]
27636 pub target_component: u8,
27637 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
27638 pub coordinate_frame: MavFrame,
27639}
27640impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
27641 pub const ENCODED_LEN: usize = 53usize;
27642 pub const DEFAULT: Self = Self {
27643 time_boot_ms: 0_u32,
27644 lat_int: 0_i32,
27645 lon_int: 0_i32,
27646 alt: 0.0_f32,
27647 vx: 0.0_f32,
27648 vy: 0.0_f32,
27649 vz: 0.0_f32,
27650 afx: 0.0_f32,
27651 afy: 0.0_f32,
27652 afz: 0.0_f32,
27653 yaw: 0.0_f32,
27654 yaw_rate: 0.0_f32,
27655 type_mask: PositionTargetTypemask::DEFAULT,
27656 target_system: 0_u8,
27657 target_component: 0_u8,
27658 coordinate_frame: MavFrame::DEFAULT,
27659 };
27660 #[cfg(feature = "arbitrary")]
27661 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27662 use arbitrary::{Arbitrary, Unstructured};
27663 let mut buf = [0u8; 1024];
27664 rng.fill_bytes(&mut buf);
27665 let mut unstructured = Unstructured::new(&buf);
27666 Self::arbitrary(&mut unstructured).unwrap_or_default()
27667 }
27668}
27669impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27670 fn default() -> Self {
27671 Self::DEFAULT.clone()
27672 }
27673}
27674impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27675 type Message = MavMessage;
27676 const ID: u32 = 86u32;
27677 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
27678 const EXTRA_CRC: u8 = 5u8;
27679 const ENCODED_LEN: usize = 53usize;
27680 fn deser(
27681 _version: MavlinkVersion,
27682 __input: &[u8],
27683 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27684 let avail_len = __input.len();
27685 let mut payload_buf = [0; Self::ENCODED_LEN];
27686 let mut buf = if avail_len < Self::ENCODED_LEN {
27687 payload_buf[0..avail_len].copy_from_slice(__input);
27688 Bytes::new(&payload_buf)
27689 } else {
27690 Bytes::new(__input)
27691 };
27692 let mut __struct = Self::default();
27693 __struct.time_boot_ms = buf.get_u32_le();
27694 __struct.lat_int = buf.get_i32_le();
27695 __struct.lon_int = buf.get_i32_le();
27696 __struct.alt = buf.get_f32_le();
27697 __struct.vx = buf.get_f32_le();
27698 __struct.vy = buf.get_f32_le();
27699 __struct.vz = buf.get_f32_le();
27700 __struct.afx = buf.get_f32_le();
27701 __struct.afy = buf.get_f32_le();
27702 __struct.afz = buf.get_f32_le();
27703 __struct.yaw = buf.get_f32_le();
27704 __struct.yaw_rate = buf.get_f32_le();
27705 let tmp = buf.get_u16_le();
27706 __struct.type_mask = PositionTargetTypemask::from_bits(
27707 tmp & PositionTargetTypemask::all().bits(),
27708 )
27709 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27710 flag_type: "PositionTargetTypemask",
27711 value: tmp as u32,
27712 })?;
27713 __struct.target_system = buf.get_u8();
27714 __struct.target_component = buf.get_u8();
27715 let tmp = buf.get_u8();
27716 __struct.coordinate_frame =
27717 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27718 enum_type: "MavFrame",
27719 value: tmp as u32,
27720 })?;
27721 Ok(__struct)
27722 }
27723 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27724 let mut __tmp = BytesMut::new(bytes);
27725 #[allow(clippy::absurd_extreme_comparisons)]
27726 #[allow(unused_comparisons)]
27727 if __tmp.remaining() < Self::ENCODED_LEN {
27728 panic!(
27729 "buffer is too small (need {} bytes, but got {})",
27730 Self::ENCODED_LEN,
27731 __tmp.remaining(),
27732 )
27733 }
27734 __tmp.put_u32_le(self.time_boot_ms);
27735 __tmp.put_i32_le(self.lat_int);
27736 __tmp.put_i32_le(self.lon_int);
27737 __tmp.put_f32_le(self.alt);
27738 __tmp.put_f32_le(self.vx);
27739 __tmp.put_f32_le(self.vy);
27740 __tmp.put_f32_le(self.vz);
27741 __tmp.put_f32_le(self.afx);
27742 __tmp.put_f32_le(self.afy);
27743 __tmp.put_f32_le(self.afz);
27744 __tmp.put_f32_le(self.yaw);
27745 __tmp.put_f32_le(self.yaw_rate);
27746 __tmp.put_u16_le(self.type_mask.bits());
27747 __tmp.put_u8(self.target_system);
27748 __tmp.put_u8(self.target_component);
27749 __tmp.put_u8(self.coordinate_frame as u8);
27750 if matches!(version, MavlinkVersion::V2) {
27751 let len = __tmp.len();
27752 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27753 } else {
27754 __tmp.len()
27755 }
27756 }
27757}
27758#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
27759#[doc = ""]
27760#[doc = "ID: 84"]
27761#[derive(Debug, Clone, PartialEq)]
27762#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27763#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27764pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
27765 #[doc = "Timestamp (time since system boot)."]
27766 pub time_boot_ms: u32,
27767 #[doc = "X Position in NED frame"]
27768 pub x: f32,
27769 #[doc = "Y Position in NED frame"]
27770 pub y: f32,
27771 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
27772 pub z: f32,
27773 #[doc = "X velocity in NED frame"]
27774 pub vx: f32,
27775 #[doc = "Y velocity in NED frame"]
27776 pub vy: f32,
27777 #[doc = "Z velocity in NED frame"]
27778 pub vz: f32,
27779 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27780 pub afx: f32,
27781 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27782 pub afy: f32,
27783 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27784 pub afz: f32,
27785 #[doc = "yaw setpoint"]
27786 pub yaw: f32,
27787 #[doc = "yaw rate setpoint"]
27788 pub yaw_rate: f32,
27789 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27790 pub type_mask: PositionTargetTypemask,
27791 #[doc = "System ID"]
27792 pub target_system: u8,
27793 #[doc = "Component ID"]
27794 pub target_component: u8,
27795 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
27796 pub coordinate_frame: MavFrame,
27797}
27798impl SET_POSITION_TARGET_LOCAL_NED_DATA {
27799 pub const ENCODED_LEN: usize = 53usize;
27800 pub const DEFAULT: Self = Self {
27801 time_boot_ms: 0_u32,
27802 x: 0.0_f32,
27803 y: 0.0_f32,
27804 z: 0.0_f32,
27805 vx: 0.0_f32,
27806 vy: 0.0_f32,
27807 vz: 0.0_f32,
27808 afx: 0.0_f32,
27809 afy: 0.0_f32,
27810 afz: 0.0_f32,
27811 yaw: 0.0_f32,
27812 yaw_rate: 0.0_f32,
27813 type_mask: PositionTargetTypemask::DEFAULT,
27814 target_system: 0_u8,
27815 target_component: 0_u8,
27816 coordinate_frame: MavFrame::DEFAULT,
27817 };
27818 #[cfg(feature = "arbitrary")]
27819 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27820 use arbitrary::{Arbitrary, Unstructured};
27821 let mut buf = [0u8; 1024];
27822 rng.fill_bytes(&mut buf);
27823 let mut unstructured = Unstructured::new(&buf);
27824 Self::arbitrary(&mut unstructured).unwrap_or_default()
27825 }
27826}
27827impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
27828 fn default() -> Self {
27829 Self::DEFAULT.clone()
27830 }
27831}
27832impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
27833 type Message = MavMessage;
27834 const ID: u32 = 84u32;
27835 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
27836 const EXTRA_CRC: u8 = 143u8;
27837 const ENCODED_LEN: usize = 53usize;
27838 fn deser(
27839 _version: MavlinkVersion,
27840 __input: &[u8],
27841 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27842 let avail_len = __input.len();
27843 let mut payload_buf = [0; Self::ENCODED_LEN];
27844 let mut buf = if avail_len < Self::ENCODED_LEN {
27845 payload_buf[0..avail_len].copy_from_slice(__input);
27846 Bytes::new(&payload_buf)
27847 } else {
27848 Bytes::new(__input)
27849 };
27850 let mut __struct = Self::default();
27851 __struct.time_boot_ms = buf.get_u32_le();
27852 __struct.x = buf.get_f32_le();
27853 __struct.y = buf.get_f32_le();
27854 __struct.z = buf.get_f32_le();
27855 __struct.vx = buf.get_f32_le();
27856 __struct.vy = buf.get_f32_le();
27857 __struct.vz = buf.get_f32_le();
27858 __struct.afx = buf.get_f32_le();
27859 __struct.afy = buf.get_f32_le();
27860 __struct.afz = buf.get_f32_le();
27861 __struct.yaw = buf.get_f32_le();
27862 __struct.yaw_rate = buf.get_f32_le();
27863 let tmp = buf.get_u16_le();
27864 __struct.type_mask = PositionTargetTypemask::from_bits(
27865 tmp & PositionTargetTypemask::all().bits(),
27866 )
27867 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27868 flag_type: "PositionTargetTypemask",
27869 value: tmp as u32,
27870 })?;
27871 __struct.target_system = buf.get_u8();
27872 __struct.target_component = buf.get_u8();
27873 let tmp = buf.get_u8();
27874 __struct.coordinate_frame =
27875 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27876 enum_type: "MavFrame",
27877 value: tmp as u32,
27878 })?;
27879 Ok(__struct)
27880 }
27881 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27882 let mut __tmp = BytesMut::new(bytes);
27883 #[allow(clippy::absurd_extreme_comparisons)]
27884 #[allow(unused_comparisons)]
27885 if __tmp.remaining() < Self::ENCODED_LEN {
27886 panic!(
27887 "buffer is too small (need {} bytes, but got {})",
27888 Self::ENCODED_LEN,
27889 __tmp.remaining(),
27890 )
27891 }
27892 __tmp.put_u32_le(self.time_boot_ms);
27893 __tmp.put_f32_le(self.x);
27894 __tmp.put_f32_le(self.y);
27895 __tmp.put_f32_le(self.z);
27896 __tmp.put_f32_le(self.vx);
27897 __tmp.put_f32_le(self.vy);
27898 __tmp.put_f32_le(self.vz);
27899 __tmp.put_f32_le(self.afx);
27900 __tmp.put_f32_le(self.afy);
27901 __tmp.put_f32_le(self.afz);
27902 __tmp.put_f32_le(self.yaw);
27903 __tmp.put_f32_le(self.yaw_rate);
27904 __tmp.put_u16_le(self.type_mask.bits());
27905 __tmp.put_u8(self.target_system);
27906 __tmp.put_u8(self.target_component);
27907 __tmp.put_u8(self.coordinate_frame as u8);
27908 if matches!(version, MavlinkVersion::V2) {
27909 let len = __tmp.len();
27910 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27911 } else {
27912 __tmp.len()
27913 }
27914 }
27915}
27916#[doc = "Status of simulation environment, if used."]
27917#[doc = ""]
27918#[doc = "ID: 108"]
27919#[derive(Debug, Clone, PartialEq)]
27920#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27922pub struct SIM_STATE_DATA {
27923 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
27924 pub q1: f32,
27925 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
27926 pub q2: f32,
27927 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
27928 pub q3: f32,
27929 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
27930 pub q4: f32,
27931 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
27932 pub roll: f32,
27933 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
27934 pub pitch: f32,
27935 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
27936 pub yaw: f32,
27937 #[doc = "X acceleration"]
27938 pub xacc: f32,
27939 #[doc = "Y acceleration"]
27940 pub yacc: f32,
27941 #[doc = "Z acceleration"]
27942 pub zacc: f32,
27943 #[doc = "Angular speed around X axis"]
27944 pub xgyro: f32,
27945 #[doc = "Angular speed around Y axis"]
27946 pub ygyro: f32,
27947 #[doc = "Angular speed around Z axis"]
27948 pub zgyro: f32,
27949 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
27950 pub lat: f32,
27951 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
27952 pub lon: f32,
27953 #[doc = "Altitude"]
27954 pub alt: f32,
27955 #[doc = "Horizontal position standard deviation"]
27956 pub std_dev_horz: f32,
27957 #[doc = "Vertical position standard deviation"]
27958 pub std_dev_vert: f32,
27959 #[doc = "True velocity in north direction in earth-fixed NED frame"]
27960 pub vn: f32,
27961 #[doc = "True velocity in east direction in earth-fixed NED frame"]
27962 pub ve: f32,
27963 #[doc = "True velocity in down direction in earth-fixed NED frame"]
27964 pub vd: f32,
27965 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
27966 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27967 pub lat_int: i32,
27968 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
27969 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27970 pub lon_int: i32,
27971}
27972impl SIM_STATE_DATA {
27973 pub const ENCODED_LEN: usize = 92usize;
27974 pub const DEFAULT: Self = Self {
27975 q1: 0.0_f32,
27976 q2: 0.0_f32,
27977 q3: 0.0_f32,
27978 q4: 0.0_f32,
27979 roll: 0.0_f32,
27980 pitch: 0.0_f32,
27981 yaw: 0.0_f32,
27982 xacc: 0.0_f32,
27983 yacc: 0.0_f32,
27984 zacc: 0.0_f32,
27985 xgyro: 0.0_f32,
27986 ygyro: 0.0_f32,
27987 zgyro: 0.0_f32,
27988 lat: 0.0_f32,
27989 lon: 0.0_f32,
27990 alt: 0.0_f32,
27991 std_dev_horz: 0.0_f32,
27992 std_dev_vert: 0.0_f32,
27993 vn: 0.0_f32,
27994 ve: 0.0_f32,
27995 vd: 0.0_f32,
27996 lat_int: 0_i32,
27997 lon_int: 0_i32,
27998 };
27999 #[cfg(feature = "arbitrary")]
28000 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28001 use arbitrary::{Arbitrary, Unstructured};
28002 let mut buf = [0u8; 1024];
28003 rng.fill_bytes(&mut buf);
28004 let mut unstructured = Unstructured::new(&buf);
28005 Self::arbitrary(&mut unstructured).unwrap_or_default()
28006 }
28007}
28008impl Default for SIM_STATE_DATA {
28009 fn default() -> Self {
28010 Self::DEFAULT.clone()
28011 }
28012}
28013impl MessageData for SIM_STATE_DATA {
28014 type Message = MavMessage;
28015 const ID: u32 = 108u32;
28016 const NAME: &'static str = "SIM_STATE";
28017 const EXTRA_CRC: u8 = 32u8;
28018 const ENCODED_LEN: usize = 92usize;
28019 fn deser(
28020 _version: MavlinkVersion,
28021 __input: &[u8],
28022 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28023 let avail_len = __input.len();
28024 let mut payload_buf = [0; Self::ENCODED_LEN];
28025 let mut buf = if avail_len < Self::ENCODED_LEN {
28026 payload_buf[0..avail_len].copy_from_slice(__input);
28027 Bytes::new(&payload_buf)
28028 } else {
28029 Bytes::new(__input)
28030 };
28031 let mut __struct = Self::default();
28032 __struct.q1 = buf.get_f32_le();
28033 __struct.q2 = buf.get_f32_le();
28034 __struct.q3 = buf.get_f32_le();
28035 __struct.q4 = buf.get_f32_le();
28036 __struct.roll = buf.get_f32_le();
28037 __struct.pitch = buf.get_f32_le();
28038 __struct.yaw = buf.get_f32_le();
28039 __struct.xacc = buf.get_f32_le();
28040 __struct.yacc = buf.get_f32_le();
28041 __struct.zacc = buf.get_f32_le();
28042 __struct.xgyro = buf.get_f32_le();
28043 __struct.ygyro = buf.get_f32_le();
28044 __struct.zgyro = buf.get_f32_le();
28045 __struct.lat = buf.get_f32_le();
28046 __struct.lon = buf.get_f32_le();
28047 __struct.alt = buf.get_f32_le();
28048 __struct.std_dev_horz = buf.get_f32_le();
28049 __struct.std_dev_vert = buf.get_f32_le();
28050 __struct.vn = buf.get_f32_le();
28051 __struct.ve = buf.get_f32_le();
28052 __struct.vd = buf.get_f32_le();
28053 __struct.lat_int = buf.get_i32_le();
28054 __struct.lon_int = buf.get_i32_le();
28055 Ok(__struct)
28056 }
28057 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28058 let mut __tmp = BytesMut::new(bytes);
28059 #[allow(clippy::absurd_extreme_comparisons)]
28060 #[allow(unused_comparisons)]
28061 if __tmp.remaining() < Self::ENCODED_LEN {
28062 panic!(
28063 "buffer is too small (need {} bytes, but got {})",
28064 Self::ENCODED_LEN,
28065 __tmp.remaining(),
28066 )
28067 }
28068 __tmp.put_f32_le(self.q1);
28069 __tmp.put_f32_le(self.q2);
28070 __tmp.put_f32_le(self.q3);
28071 __tmp.put_f32_le(self.q4);
28072 __tmp.put_f32_le(self.roll);
28073 __tmp.put_f32_le(self.pitch);
28074 __tmp.put_f32_le(self.yaw);
28075 __tmp.put_f32_le(self.xacc);
28076 __tmp.put_f32_le(self.yacc);
28077 __tmp.put_f32_le(self.zacc);
28078 __tmp.put_f32_le(self.xgyro);
28079 __tmp.put_f32_le(self.ygyro);
28080 __tmp.put_f32_le(self.zgyro);
28081 __tmp.put_f32_le(self.lat);
28082 __tmp.put_f32_le(self.lon);
28083 __tmp.put_f32_le(self.alt);
28084 __tmp.put_f32_le(self.std_dev_horz);
28085 __tmp.put_f32_le(self.std_dev_vert);
28086 __tmp.put_f32_le(self.vn);
28087 __tmp.put_f32_le(self.ve);
28088 __tmp.put_f32_le(self.vd);
28089 if matches!(version, MavlinkVersion::V2) {
28090 __tmp.put_i32_le(self.lat_int);
28091 __tmp.put_i32_le(self.lon_int);
28092 let len = __tmp.len();
28093 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28094 } else {
28095 __tmp.len()
28096 }
28097 }
28098}
28099#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
28100#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
28101#[doc = ""]
28102#[doc = "ID: 370"]
28103#[derive(Debug, Clone, PartialEq)]
28104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28105#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28106pub struct SMART_BATTERY_INFO_DATA {
28107 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
28108 pub capacity_full_specification: i32,
28109 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
28110 pub capacity_full: i32,
28111 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
28112 pub cycle_count: u16,
28113 #[doc = "Battery weight. 0: field not provided."]
28114 pub weight: u16,
28115 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
28116 pub discharge_minimum_voltage: u16,
28117 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
28118 pub charging_minimum_voltage: u16,
28119 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
28120 pub resting_minimum_voltage: u16,
28121 #[doc = "Battery ID"]
28122 pub id: u8,
28123 #[doc = "Function of the battery"]
28124 pub battery_function: MavBatteryFunction,
28125 #[doc = "Type (chemistry) of the battery"]
28126 pub mavtype: MavBatteryType,
28127 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
28128 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28129 pub serial_number: [u8; 16],
28130 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
28131 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28132 pub device_name: [u8; 50],
28133 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
28134 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28135 pub charging_maximum_voltage: u16,
28136 #[doc = "Number of battery cells in series. 0: field not provided."]
28137 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28138 pub cells_in_series: u8,
28139 #[doc = "Maximum pack discharge current. 0: field not provided."]
28140 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28141 pub discharge_maximum_current: u32,
28142 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
28143 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28144 pub discharge_maximum_burst_current: u32,
28145 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
28146 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28147 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28148 pub manufacture_date: [u8; 11],
28149}
28150impl SMART_BATTERY_INFO_DATA {
28151 pub const ENCODED_LEN: usize = 109usize;
28152 pub const DEFAULT: Self = Self {
28153 capacity_full_specification: 0_i32,
28154 capacity_full: 0_i32,
28155 cycle_count: 0_u16,
28156 weight: 0_u16,
28157 discharge_minimum_voltage: 0_u16,
28158 charging_minimum_voltage: 0_u16,
28159 resting_minimum_voltage: 0_u16,
28160 id: 0_u8,
28161 battery_function: MavBatteryFunction::DEFAULT,
28162 mavtype: MavBatteryType::DEFAULT,
28163 serial_number: [0_u8; 16usize],
28164 device_name: [0_u8; 50usize],
28165 charging_maximum_voltage: 0_u16,
28166 cells_in_series: 0_u8,
28167 discharge_maximum_current: 0_u32,
28168 discharge_maximum_burst_current: 0_u32,
28169 manufacture_date: [0_u8; 11usize],
28170 };
28171 #[cfg(feature = "arbitrary")]
28172 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28173 use arbitrary::{Arbitrary, Unstructured};
28174 let mut buf = [0u8; 1024];
28175 rng.fill_bytes(&mut buf);
28176 let mut unstructured = Unstructured::new(&buf);
28177 Self::arbitrary(&mut unstructured).unwrap_or_default()
28178 }
28179}
28180impl Default for SMART_BATTERY_INFO_DATA {
28181 fn default() -> Self {
28182 Self::DEFAULT.clone()
28183 }
28184}
28185impl MessageData for SMART_BATTERY_INFO_DATA {
28186 type Message = MavMessage;
28187 const ID: u32 = 370u32;
28188 const NAME: &'static str = "SMART_BATTERY_INFO";
28189 const EXTRA_CRC: u8 = 75u8;
28190 const ENCODED_LEN: usize = 109usize;
28191 fn deser(
28192 _version: MavlinkVersion,
28193 __input: &[u8],
28194 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28195 let avail_len = __input.len();
28196 let mut payload_buf = [0; Self::ENCODED_LEN];
28197 let mut buf = if avail_len < Self::ENCODED_LEN {
28198 payload_buf[0..avail_len].copy_from_slice(__input);
28199 Bytes::new(&payload_buf)
28200 } else {
28201 Bytes::new(__input)
28202 };
28203 let mut __struct = Self::default();
28204 __struct.capacity_full_specification = buf.get_i32_le();
28205 __struct.capacity_full = buf.get_i32_le();
28206 __struct.cycle_count = buf.get_u16_le();
28207 __struct.weight = buf.get_u16_le();
28208 __struct.discharge_minimum_voltage = buf.get_u16_le();
28209 __struct.charging_minimum_voltage = buf.get_u16_le();
28210 __struct.resting_minimum_voltage = buf.get_u16_le();
28211 __struct.id = buf.get_u8();
28212 let tmp = buf.get_u8();
28213 __struct.battery_function =
28214 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28215 enum_type: "MavBatteryFunction",
28216 value: tmp as u32,
28217 })?;
28218 let tmp = buf.get_u8();
28219 __struct.mavtype =
28220 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28221 enum_type: "MavBatteryType",
28222 value: tmp as u32,
28223 })?;
28224 for v in &mut __struct.serial_number {
28225 let val = buf.get_u8();
28226 *v = val;
28227 }
28228 for v in &mut __struct.device_name {
28229 let val = buf.get_u8();
28230 *v = val;
28231 }
28232 __struct.charging_maximum_voltage = buf.get_u16_le();
28233 __struct.cells_in_series = buf.get_u8();
28234 __struct.discharge_maximum_current = buf.get_u32_le();
28235 __struct.discharge_maximum_burst_current = buf.get_u32_le();
28236 for v in &mut __struct.manufacture_date {
28237 let val = buf.get_u8();
28238 *v = val;
28239 }
28240 Ok(__struct)
28241 }
28242 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28243 let mut __tmp = BytesMut::new(bytes);
28244 #[allow(clippy::absurd_extreme_comparisons)]
28245 #[allow(unused_comparisons)]
28246 if __tmp.remaining() < Self::ENCODED_LEN {
28247 panic!(
28248 "buffer is too small (need {} bytes, but got {})",
28249 Self::ENCODED_LEN,
28250 __tmp.remaining(),
28251 )
28252 }
28253 __tmp.put_i32_le(self.capacity_full_specification);
28254 __tmp.put_i32_le(self.capacity_full);
28255 __tmp.put_u16_le(self.cycle_count);
28256 __tmp.put_u16_le(self.weight);
28257 __tmp.put_u16_le(self.discharge_minimum_voltage);
28258 __tmp.put_u16_le(self.charging_minimum_voltage);
28259 __tmp.put_u16_le(self.resting_minimum_voltage);
28260 __tmp.put_u8(self.id);
28261 __tmp.put_u8(self.battery_function as u8);
28262 __tmp.put_u8(self.mavtype as u8);
28263 for val in &self.serial_number {
28264 __tmp.put_u8(*val);
28265 }
28266 for val in &self.device_name {
28267 __tmp.put_u8(*val);
28268 }
28269 if matches!(version, MavlinkVersion::V2) {
28270 __tmp.put_u16_le(self.charging_maximum_voltage);
28271 __tmp.put_u8(self.cells_in_series);
28272 __tmp.put_u32_le(self.discharge_maximum_current);
28273 __tmp.put_u32_le(self.discharge_maximum_burst_current);
28274 for val in &self.manufacture_date {
28275 __tmp.put_u8(*val);
28276 }
28277 let len = __tmp.len();
28278 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28279 } else {
28280 __tmp.len()
28281 }
28282 }
28283}
28284#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
28285#[doc = ""]
28286#[doc = "ID: 253"]
28287#[derive(Debug, Clone, PartialEq)]
28288#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28290pub struct STATUSTEXT_DATA {
28291 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
28292 pub severity: MavSeverity,
28293 #[doc = "Status text message, without null termination character"]
28294 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28295 pub text: [u8; 50],
28296 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
28297 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28298 pub id: u16,
28299 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
28300 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28301 pub chunk_seq: u8,
28302}
28303impl STATUSTEXT_DATA {
28304 pub const ENCODED_LEN: usize = 54usize;
28305 pub const DEFAULT: Self = Self {
28306 severity: MavSeverity::DEFAULT,
28307 text: [0_u8; 50usize],
28308 id: 0_u16,
28309 chunk_seq: 0_u8,
28310 };
28311 #[cfg(feature = "arbitrary")]
28312 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28313 use arbitrary::{Arbitrary, Unstructured};
28314 let mut buf = [0u8; 1024];
28315 rng.fill_bytes(&mut buf);
28316 let mut unstructured = Unstructured::new(&buf);
28317 Self::arbitrary(&mut unstructured).unwrap_or_default()
28318 }
28319}
28320impl Default for STATUSTEXT_DATA {
28321 fn default() -> Self {
28322 Self::DEFAULT.clone()
28323 }
28324}
28325impl MessageData for STATUSTEXT_DATA {
28326 type Message = MavMessage;
28327 const ID: u32 = 253u32;
28328 const NAME: &'static str = "STATUSTEXT";
28329 const EXTRA_CRC: u8 = 83u8;
28330 const ENCODED_LEN: usize = 54usize;
28331 fn deser(
28332 _version: MavlinkVersion,
28333 __input: &[u8],
28334 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28335 let avail_len = __input.len();
28336 let mut payload_buf = [0; Self::ENCODED_LEN];
28337 let mut buf = if avail_len < Self::ENCODED_LEN {
28338 payload_buf[0..avail_len].copy_from_slice(__input);
28339 Bytes::new(&payload_buf)
28340 } else {
28341 Bytes::new(__input)
28342 };
28343 let mut __struct = Self::default();
28344 let tmp = buf.get_u8();
28345 __struct.severity =
28346 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28347 enum_type: "MavSeverity",
28348 value: tmp as u32,
28349 })?;
28350 for v in &mut __struct.text {
28351 let val = buf.get_u8();
28352 *v = val;
28353 }
28354 __struct.id = buf.get_u16_le();
28355 __struct.chunk_seq = buf.get_u8();
28356 Ok(__struct)
28357 }
28358 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28359 let mut __tmp = BytesMut::new(bytes);
28360 #[allow(clippy::absurd_extreme_comparisons)]
28361 #[allow(unused_comparisons)]
28362 if __tmp.remaining() < Self::ENCODED_LEN {
28363 panic!(
28364 "buffer is too small (need {} bytes, but got {})",
28365 Self::ENCODED_LEN,
28366 __tmp.remaining(),
28367 )
28368 }
28369 __tmp.put_u8(self.severity as u8);
28370 for val in &self.text {
28371 __tmp.put_u8(*val);
28372 }
28373 if matches!(version, MavlinkVersion::V2) {
28374 __tmp.put_u16_le(self.id);
28375 __tmp.put_u8(self.chunk_seq);
28376 let len = __tmp.len();
28377 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28378 } else {
28379 __tmp.len()
28380 }
28381 }
28382}
28383#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
28384#[doc = ""]
28385#[doc = "ID: 261"]
28386#[derive(Debug, Clone, PartialEq)]
28387#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28388#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28389pub struct STORAGE_INFORMATION_DATA {
28390 #[doc = "Timestamp (time since system boot)."]
28391 pub time_boot_ms: u32,
28392 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28393 pub total_capacity: f32,
28394 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28395 pub used_capacity: f32,
28396 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28397 pub available_capacity: f32,
28398 #[doc = "Read speed."]
28399 pub read_speed: f32,
28400 #[doc = "Write speed."]
28401 pub write_speed: f32,
28402 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
28403 pub storage_id: u8,
28404 #[doc = "Number of storage devices"]
28405 pub storage_count: u8,
28406 #[doc = "Status of storage"]
28407 pub status: StorageStatus,
28408 #[doc = "Type of storage"]
28409 #[cfg_attr(feature = "serde", serde(default))]
28410 pub mavtype: StorageType,
28411 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
28412 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28413 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28414 pub name: [u8; 32],
28415 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
28416 #[cfg_attr(feature = "serde", serde(default))]
28417 pub storage_usage: StorageUsageFlag,
28418}
28419impl STORAGE_INFORMATION_DATA {
28420 pub const ENCODED_LEN: usize = 61usize;
28421 pub const DEFAULT: Self = Self {
28422 time_boot_ms: 0_u32,
28423 total_capacity: 0.0_f32,
28424 used_capacity: 0.0_f32,
28425 available_capacity: 0.0_f32,
28426 read_speed: 0.0_f32,
28427 write_speed: 0.0_f32,
28428 storage_id: 0_u8,
28429 storage_count: 0_u8,
28430 status: StorageStatus::DEFAULT,
28431 mavtype: StorageType::DEFAULT,
28432 name: [0_u8; 32usize],
28433 storage_usage: StorageUsageFlag::DEFAULT,
28434 };
28435 #[cfg(feature = "arbitrary")]
28436 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28437 use arbitrary::{Arbitrary, Unstructured};
28438 let mut buf = [0u8; 1024];
28439 rng.fill_bytes(&mut buf);
28440 let mut unstructured = Unstructured::new(&buf);
28441 Self::arbitrary(&mut unstructured).unwrap_or_default()
28442 }
28443}
28444impl Default for STORAGE_INFORMATION_DATA {
28445 fn default() -> Self {
28446 Self::DEFAULT.clone()
28447 }
28448}
28449impl MessageData for STORAGE_INFORMATION_DATA {
28450 type Message = MavMessage;
28451 const ID: u32 = 261u32;
28452 const NAME: &'static str = "STORAGE_INFORMATION";
28453 const EXTRA_CRC: u8 = 179u8;
28454 const ENCODED_LEN: usize = 61usize;
28455 fn deser(
28456 _version: MavlinkVersion,
28457 __input: &[u8],
28458 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28459 let avail_len = __input.len();
28460 let mut payload_buf = [0; Self::ENCODED_LEN];
28461 let mut buf = if avail_len < Self::ENCODED_LEN {
28462 payload_buf[0..avail_len].copy_from_slice(__input);
28463 Bytes::new(&payload_buf)
28464 } else {
28465 Bytes::new(__input)
28466 };
28467 let mut __struct = Self::default();
28468 __struct.time_boot_ms = buf.get_u32_le();
28469 __struct.total_capacity = buf.get_f32_le();
28470 __struct.used_capacity = buf.get_f32_le();
28471 __struct.available_capacity = buf.get_f32_le();
28472 __struct.read_speed = buf.get_f32_le();
28473 __struct.write_speed = buf.get_f32_le();
28474 __struct.storage_id = buf.get_u8();
28475 __struct.storage_count = buf.get_u8();
28476 let tmp = buf.get_u8();
28477 __struct.status =
28478 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28479 enum_type: "StorageStatus",
28480 value: tmp as u32,
28481 })?;
28482 let tmp = buf.get_u8();
28483 __struct.mavtype =
28484 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28485 enum_type: "StorageType",
28486 value: tmp as u32,
28487 })?;
28488 for v in &mut __struct.name {
28489 let val = buf.get_u8();
28490 *v = val;
28491 }
28492 let tmp = buf.get_u8();
28493 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
28494 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28495 flag_type: "StorageUsageFlag",
28496 value: tmp as u32,
28497 })?;
28498 Ok(__struct)
28499 }
28500 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28501 let mut __tmp = BytesMut::new(bytes);
28502 #[allow(clippy::absurd_extreme_comparisons)]
28503 #[allow(unused_comparisons)]
28504 if __tmp.remaining() < Self::ENCODED_LEN {
28505 panic!(
28506 "buffer is too small (need {} bytes, but got {})",
28507 Self::ENCODED_LEN,
28508 __tmp.remaining(),
28509 )
28510 }
28511 __tmp.put_u32_le(self.time_boot_ms);
28512 __tmp.put_f32_le(self.total_capacity);
28513 __tmp.put_f32_le(self.used_capacity);
28514 __tmp.put_f32_le(self.available_capacity);
28515 __tmp.put_f32_le(self.read_speed);
28516 __tmp.put_f32_le(self.write_speed);
28517 __tmp.put_u8(self.storage_id);
28518 __tmp.put_u8(self.storage_count);
28519 __tmp.put_u8(self.status as u8);
28520 if matches!(version, MavlinkVersion::V2) {
28521 __tmp.put_u8(self.mavtype as u8);
28522 for val in &self.name {
28523 __tmp.put_u8(*val);
28524 }
28525 __tmp.put_u8(self.storage_usage.bits());
28526 let len = __tmp.len();
28527 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28528 } else {
28529 __tmp.len()
28530 }
28531 }
28532}
28533#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
28534#[doc = ""]
28535#[doc = "ID: 401"]
28536#[derive(Debug, Clone, PartialEq)]
28537#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28538#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28539pub struct SUPPORTED_TUNES_DATA {
28540 #[doc = "Bitfield of supported tune formats."]
28541 pub format: TuneFormat,
28542 #[doc = "System ID"]
28543 pub target_system: u8,
28544 #[doc = "Component ID"]
28545 pub target_component: u8,
28546}
28547impl SUPPORTED_TUNES_DATA {
28548 pub const ENCODED_LEN: usize = 6usize;
28549 pub const DEFAULT: Self = Self {
28550 format: TuneFormat::DEFAULT,
28551 target_system: 0_u8,
28552 target_component: 0_u8,
28553 };
28554 #[cfg(feature = "arbitrary")]
28555 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28556 use arbitrary::{Arbitrary, Unstructured};
28557 let mut buf = [0u8; 1024];
28558 rng.fill_bytes(&mut buf);
28559 let mut unstructured = Unstructured::new(&buf);
28560 Self::arbitrary(&mut unstructured).unwrap_or_default()
28561 }
28562}
28563impl Default for SUPPORTED_TUNES_DATA {
28564 fn default() -> Self {
28565 Self::DEFAULT.clone()
28566 }
28567}
28568impl MessageData for SUPPORTED_TUNES_DATA {
28569 type Message = MavMessage;
28570 const ID: u32 = 401u32;
28571 const NAME: &'static str = "SUPPORTED_TUNES";
28572 const EXTRA_CRC: u8 = 183u8;
28573 const ENCODED_LEN: usize = 6usize;
28574 fn deser(
28575 _version: MavlinkVersion,
28576 __input: &[u8],
28577 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28578 let avail_len = __input.len();
28579 let mut payload_buf = [0; Self::ENCODED_LEN];
28580 let mut buf = if avail_len < Self::ENCODED_LEN {
28581 payload_buf[0..avail_len].copy_from_slice(__input);
28582 Bytes::new(&payload_buf)
28583 } else {
28584 Bytes::new(__input)
28585 };
28586 let mut __struct = Self::default();
28587 let tmp = buf.get_u32_le();
28588 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
28589 ::mavlink_core::error::ParserError::InvalidEnum {
28590 enum_type: "TuneFormat",
28591 value: tmp as u32,
28592 },
28593 )?;
28594 __struct.target_system = buf.get_u8();
28595 __struct.target_component = buf.get_u8();
28596 Ok(__struct)
28597 }
28598 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28599 let mut __tmp = BytesMut::new(bytes);
28600 #[allow(clippy::absurd_extreme_comparisons)]
28601 #[allow(unused_comparisons)]
28602 if __tmp.remaining() < Self::ENCODED_LEN {
28603 panic!(
28604 "buffer is too small (need {} bytes, but got {})",
28605 Self::ENCODED_LEN,
28606 __tmp.remaining(),
28607 )
28608 }
28609 __tmp.put_u32_le(self.format as u32);
28610 __tmp.put_u8(self.target_system);
28611 __tmp.put_u8(self.target_component);
28612 if matches!(version, MavlinkVersion::V2) {
28613 let len = __tmp.len();
28614 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28615 } else {
28616 __tmp.len()
28617 }
28618 }
28619}
28620#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
28621#[doc = ""]
28622#[doc = "ID: 2"]
28623#[derive(Debug, Clone, PartialEq)]
28624#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28625#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28626pub struct SYSTEM_TIME_DATA {
28627 #[doc = "Timestamp (UNIX epoch time)."]
28628 pub time_unix_usec: u64,
28629 #[doc = "Timestamp (time since system boot)."]
28630 pub time_boot_ms: u32,
28631}
28632impl SYSTEM_TIME_DATA {
28633 pub const ENCODED_LEN: usize = 12usize;
28634 pub const DEFAULT: Self = Self {
28635 time_unix_usec: 0_u64,
28636 time_boot_ms: 0_u32,
28637 };
28638 #[cfg(feature = "arbitrary")]
28639 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28640 use arbitrary::{Arbitrary, Unstructured};
28641 let mut buf = [0u8; 1024];
28642 rng.fill_bytes(&mut buf);
28643 let mut unstructured = Unstructured::new(&buf);
28644 Self::arbitrary(&mut unstructured).unwrap_or_default()
28645 }
28646}
28647impl Default for SYSTEM_TIME_DATA {
28648 fn default() -> Self {
28649 Self::DEFAULT.clone()
28650 }
28651}
28652impl MessageData for SYSTEM_TIME_DATA {
28653 type Message = MavMessage;
28654 const ID: u32 = 2u32;
28655 const NAME: &'static str = "SYSTEM_TIME";
28656 const EXTRA_CRC: u8 = 137u8;
28657 const ENCODED_LEN: usize = 12usize;
28658 fn deser(
28659 _version: MavlinkVersion,
28660 __input: &[u8],
28661 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28662 let avail_len = __input.len();
28663 let mut payload_buf = [0; Self::ENCODED_LEN];
28664 let mut buf = if avail_len < Self::ENCODED_LEN {
28665 payload_buf[0..avail_len].copy_from_slice(__input);
28666 Bytes::new(&payload_buf)
28667 } else {
28668 Bytes::new(__input)
28669 };
28670 let mut __struct = Self::default();
28671 __struct.time_unix_usec = buf.get_u64_le();
28672 __struct.time_boot_ms = buf.get_u32_le();
28673 Ok(__struct)
28674 }
28675 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28676 let mut __tmp = BytesMut::new(bytes);
28677 #[allow(clippy::absurd_extreme_comparisons)]
28678 #[allow(unused_comparisons)]
28679 if __tmp.remaining() < Self::ENCODED_LEN {
28680 panic!(
28681 "buffer is too small (need {} bytes, but got {})",
28682 Self::ENCODED_LEN,
28683 __tmp.remaining(),
28684 )
28685 }
28686 __tmp.put_u64_le(self.time_unix_usec);
28687 __tmp.put_u32_le(self.time_boot_ms);
28688 if matches!(version, MavlinkVersion::V2) {
28689 let len = __tmp.len();
28690 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28691 } else {
28692 __tmp.len()
28693 }
28694 }
28695}
28696#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
28697#[doc = ""]
28698#[doc = "ID: 1"]
28699#[derive(Debug, Clone, PartialEq)]
28700#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28701#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28702pub struct SYS_STATUS_DATA {
28703 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28704 pub onboard_control_sensors_present: MavSysStatusSensor,
28705 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28706 pub onboard_control_sensors_enabled: MavSysStatusSensor,
28707 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28708 pub onboard_control_sensors_health: MavSysStatusSensor,
28709 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
28710 pub load: u16,
28711 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
28712 pub voltage_battery: u16,
28713 #[doc = "Battery current, -1: Current not sent by autopilot"]
28714 pub current_battery: i16,
28715 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28716 pub drop_rate_comm: u16,
28717 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28718 pub errors_comm: u16,
28719 #[doc = "Autopilot-specific errors"]
28720 pub errors_count1: u16,
28721 #[doc = "Autopilot-specific errors"]
28722 pub errors_count2: u16,
28723 #[doc = "Autopilot-specific errors"]
28724 pub errors_count3: u16,
28725 #[doc = "Autopilot-specific errors"]
28726 pub errors_count4: u16,
28727 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
28728 pub battery_remaining: i8,
28729 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28730 #[cfg_attr(feature = "serde", serde(default))]
28731 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
28732 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28733 #[cfg_attr(feature = "serde", serde(default))]
28734 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
28735 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28736 #[cfg_attr(feature = "serde", serde(default))]
28737 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
28738}
28739impl SYS_STATUS_DATA {
28740 pub const ENCODED_LEN: usize = 43usize;
28741 pub const DEFAULT: Self = Self {
28742 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
28743 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
28744 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
28745 load: 0_u16,
28746 voltage_battery: 0_u16,
28747 current_battery: 0_i16,
28748 drop_rate_comm: 0_u16,
28749 errors_comm: 0_u16,
28750 errors_count1: 0_u16,
28751 errors_count2: 0_u16,
28752 errors_count3: 0_u16,
28753 errors_count4: 0_u16,
28754 battery_remaining: 0_i8,
28755 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
28756 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
28757 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
28758 };
28759 #[cfg(feature = "arbitrary")]
28760 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28761 use arbitrary::{Arbitrary, Unstructured};
28762 let mut buf = [0u8; 1024];
28763 rng.fill_bytes(&mut buf);
28764 let mut unstructured = Unstructured::new(&buf);
28765 Self::arbitrary(&mut unstructured).unwrap_or_default()
28766 }
28767}
28768impl Default for SYS_STATUS_DATA {
28769 fn default() -> Self {
28770 Self::DEFAULT.clone()
28771 }
28772}
28773impl MessageData for SYS_STATUS_DATA {
28774 type Message = MavMessage;
28775 const ID: u32 = 1u32;
28776 const NAME: &'static str = "SYS_STATUS";
28777 const EXTRA_CRC: u8 = 124u8;
28778 const ENCODED_LEN: usize = 43usize;
28779 fn deser(
28780 _version: MavlinkVersion,
28781 __input: &[u8],
28782 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28783 let avail_len = __input.len();
28784 let mut payload_buf = [0; Self::ENCODED_LEN];
28785 let mut buf = if avail_len < Self::ENCODED_LEN {
28786 payload_buf[0..avail_len].copy_from_slice(__input);
28787 Bytes::new(&payload_buf)
28788 } else {
28789 Bytes::new(__input)
28790 };
28791 let mut __struct = Self::default();
28792 let tmp = buf.get_u32_le();
28793 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
28794 tmp & MavSysStatusSensor::all().bits(),
28795 )
28796 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28797 flag_type: "MavSysStatusSensor",
28798 value: tmp as u32,
28799 })?;
28800 let tmp = buf.get_u32_le();
28801 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
28802 tmp & MavSysStatusSensor::all().bits(),
28803 )
28804 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28805 flag_type: "MavSysStatusSensor",
28806 value: tmp as u32,
28807 })?;
28808 let tmp = buf.get_u32_le();
28809 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
28810 tmp & MavSysStatusSensor::all().bits(),
28811 )
28812 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28813 flag_type: "MavSysStatusSensor",
28814 value: tmp as u32,
28815 })?;
28816 __struct.load = buf.get_u16_le();
28817 __struct.voltage_battery = buf.get_u16_le();
28818 __struct.current_battery = buf.get_i16_le();
28819 __struct.drop_rate_comm = buf.get_u16_le();
28820 __struct.errors_comm = buf.get_u16_le();
28821 __struct.errors_count1 = buf.get_u16_le();
28822 __struct.errors_count2 = buf.get_u16_le();
28823 __struct.errors_count3 = buf.get_u16_le();
28824 __struct.errors_count4 = buf.get_u16_le();
28825 __struct.battery_remaining = buf.get_i8();
28826 let tmp = buf.get_u32_le();
28827 __struct.onboard_control_sensors_present_extended =
28828 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28829 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28830 flag_type: "MavSysStatusSensorExtended",
28831 value: tmp as u32,
28832 })?;
28833 let tmp = buf.get_u32_le();
28834 __struct.onboard_control_sensors_enabled_extended =
28835 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28836 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28837 flag_type: "MavSysStatusSensorExtended",
28838 value: tmp as u32,
28839 })?;
28840 let tmp = buf.get_u32_le();
28841 __struct.onboard_control_sensors_health_extended =
28842 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28843 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28844 flag_type: "MavSysStatusSensorExtended",
28845 value: tmp as u32,
28846 })?;
28847 Ok(__struct)
28848 }
28849 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28850 let mut __tmp = BytesMut::new(bytes);
28851 #[allow(clippy::absurd_extreme_comparisons)]
28852 #[allow(unused_comparisons)]
28853 if __tmp.remaining() < Self::ENCODED_LEN {
28854 panic!(
28855 "buffer is too small (need {} bytes, but got {})",
28856 Self::ENCODED_LEN,
28857 __tmp.remaining(),
28858 )
28859 }
28860 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
28861 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
28862 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
28863 __tmp.put_u16_le(self.load);
28864 __tmp.put_u16_le(self.voltage_battery);
28865 __tmp.put_i16_le(self.current_battery);
28866 __tmp.put_u16_le(self.drop_rate_comm);
28867 __tmp.put_u16_le(self.errors_comm);
28868 __tmp.put_u16_le(self.errors_count1);
28869 __tmp.put_u16_le(self.errors_count2);
28870 __tmp.put_u16_le(self.errors_count3);
28871 __tmp.put_u16_le(self.errors_count4);
28872 __tmp.put_i8(self.battery_remaining);
28873 if matches!(version, MavlinkVersion::V2) {
28874 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
28875 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
28876 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
28877 let len = __tmp.len();
28878 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28879 } else {
28880 __tmp.len()
28881 }
28882 }
28883}
28884#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
28885#[doc = ""]
28886#[doc = "ID: 135"]
28887#[derive(Debug, Clone, PartialEq)]
28888#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28889#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28890pub struct TERRAIN_CHECK_DATA {
28891 #[doc = "Latitude"]
28892 pub lat: i32,
28893 #[doc = "Longitude"]
28894 pub lon: i32,
28895}
28896impl TERRAIN_CHECK_DATA {
28897 pub const ENCODED_LEN: usize = 8usize;
28898 pub const DEFAULT: Self = Self {
28899 lat: 0_i32,
28900 lon: 0_i32,
28901 };
28902 #[cfg(feature = "arbitrary")]
28903 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28904 use arbitrary::{Arbitrary, Unstructured};
28905 let mut buf = [0u8; 1024];
28906 rng.fill_bytes(&mut buf);
28907 let mut unstructured = Unstructured::new(&buf);
28908 Self::arbitrary(&mut unstructured).unwrap_or_default()
28909 }
28910}
28911impl Default for TERRAIN_CHECK_DATA {
28912 fn default() -> Self {
28913 Self::DEFAULT.clone()
28914 }
28915}
28916impl MessageData for TERRAIN_CHECK_DATA {
28917 type Message = MavMessage;
28918 const ID: u32 = 135u32;
28919 const NAME: &'static str = "TERRAIN_CHECK";
28920 const EXTRA_CRC: u8 = 203u8;
28921 const ENCODED_LEN: usize = 8usize;
28922 fn deser(
28923 _version: MavlinkVersion,
28924 __input: &[u8],
28925 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28926 let avail_len = __input.len();
28927 let mut payload_buf = [0; Self::ENCODED_LEN];
28928 let mut buf = if avail_len < Self::ENCODED_LEN {
28929 payload_buf[0..avail_len].copy_from_slice(__input);
28930 Bytes::new(&payload_buf)
28931 } else {
28932 Bytes::new(__input)
28933 };
28934 let mut __struct = Self::default();
28935 __struct.lat = buf.get_i32_le();
28936 __struct.lon = buf.get_i32_le();
28937 Ok(__struct)
28938 }
28939 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28940 let mut __tmp = BytesMut::new(bytes);
28941 #[allow(clippy::absurd_extreme_comparisons)]
28942 #[allow(unused_comparisons)]
28943 if __tmp.remaining() < Self::ENCODED_LEN {
28944 panic!(
28945 "buffer is too small (need {} bytes, but got {})",
28946 Self::ENCODED_LEN,
28947 __tmp.remaining(),
28948 )
28949 }
28950 __tmp.put_i32_le(self.lat);
28951 __tmp.put_i32_le(self.lon);
28952 if matches!(version, MavlinkVersion::V2) {
28953 let len = __tmp.len();
28954 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28955 } else {
28956 __tmp.len()
28957 }
28958 }
28959}
28960#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28961#[doc = ""]
28962#[doc = "ID: 134"]
28963#[derive(Debug, Clone, PartialEq)]
28964#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28965#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28966pub struct TERRAIN_DATA_DATA {
28967 #[doc = "Latitude of SW corner of first grid"]
28968 pub lat: i32,
28969 #[doc = "Longitude of SW corner of first grid"]
28970 pub lon: i32,
28971 #[doc = "Grid spacing"]
28972 pub grid_spacing: u16,
28973 #[doc = "Terrain data MSL"]
28974 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28975 pub data: [i16; 16],
28976 #[doc = "bit within the terrain request mask"]
28977 pub gridbit: u8,
28978}
28979impl TERRAIN_DATA_DATA {
28980 pub const ENCODED_LEN: usize = 43usize;
28981 pub const DEFAULT: Self = Self {
28982 lat: 0_i32,
28983 lon: 0_i32,
28984 grid_spacing: 0_u16,
28985 data: [0_i16; 16usize],
28986 gridbit: 0_u8,
28987 };
28988 #[cfg(feature = "arbitrary")]
28989 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28990 use arbitrary::{Arbitrary, Unstructured};
28991 let mut buf = [0u8; 1024];
28992 rng.fill_bytes(&mut buf);
28993 let mut unstructured = Unstructured::new(&buf);
28994 Self::arbitrary(&mut unstructured).unwrap_or_default()
28995 }
28996}
28997impl Default for TERRAIN_DATA_DATA {
28998 fn default() -> Self {
28999 Self::DEFAULT.clone()
29000 }
29001}
29002impl MessageData for TERRAIN_DATA_DATA {
29003 type Message = MavMessage;
29004 const ID: u32 = 134u32;
29005 const NAME: &'static str = "TERRAIN_DATA";
29006 const EXTRA_CRC: u8 = 229u8;
29007 const ENCODED_LEN: usize = 43usize;
29008 fn deser(
29009 _version: MavlinkVersion,
29010 __input: &[u8],
29011 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29012 let avail_len = __input.len();
29013 let mut payload_buf = [0; Self::ENCODED_LEN];
29014 let mut buf = if avail_len < Self::ENCODED_LEN {
29015 payload_buf[0..avail_len].copy_from_slice(__input);
29016 Bytes::new(&payload_buf)
29017 } else {
29018 Bytes::new(__input)
29019 };
29020 let mut __struct = Self::default();
29021 __struct.lat = buf.get_i32_le();
29022 __struct.lon = buf.get_i32_le();
29023 __struct.grid_spacing = buf.get_u16_le();
29024 for v in &mut __struct.data {
29025 let val = buf.get_i16_le();
29026 *v = val;
29027 }
29028 __struct.gridbit = buf.get_u8();
29029 Ok(__struct)
29030 }
29031 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29032 let mut __tmp = BytesMut::new(bytes);
29033 #[allow(clippy::absurd_extreme_comparisons)]
29034 #[allow(unused_comparisons)]
29035 if __tmp.remaining() < Self::ENCODED_LEN {
29036 panic!(
29037 "buffer is too small (need {} bytes, but got {})",
29038 Self::ENCODED_LEN,
29039 __tmp.remaining(),
29040 )
29041 }
29042 __tmp.put_i32_le(self.lat);
29043 __tmp.put_i32_le(self.lon);
29044 __tmp.put_u16_le(self.grid_spacing);
29045 for val in &self.data {
29046 __tmp.put_i16_le(*val);
29047 }
29048 __tmp.put_u8(self.gridbit);
29049 if matches!(version, MavlinkVersion::V2) {
29050 let len = __tmp.len();
29051 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29052 } else {
29053 __tmp.len()
29054 }
29055 }
29056}
29057#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29058#[doc = ""]
29059#[doc = "ID: 136"]
29060#[derive(Debug, Clone, PartialEq)]
29061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29062#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29063pub struct TERRAIN_REPORT_DATA {
29064 #[doc = "Latitude"]
29065 pub lat: i32,
29066 #[doc = "Longitude"]
29067 pub lon: i32,
29068 #[doc = "Terrain height MSL"]
29069 pub terrain_height: f32,
29070 #[doc = "Current vehicle height above lat/lon terrain height"]
29071 pub current_height: f32,
29072 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
29073 pub spacing: u16,
29074 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
29075 pub pending: u16,
29076 #[doc = "Number of 4x4 terrain blocks in memory"]
29077 pub loaded: u16,
29078}
29079impl TERRAIN_REPORT_DATA {
29080 pub const ENCODED_LEN: usize = 22usize;
29081 pub const DEFAULT: Self = Self {
29082 lat: 0_i32,
29083 lon: 0_i32,
29084 terrain_height: 0.0_f32,
29085 current_height: 0.0_f32,
29086 spacing: 0_u16,
29087 pending: 0_u16,
29088 loaded: 0_u16,
29089 };
29090 #[cfg(feature = "arbitrary")]
29091 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29092 use arbitrary::{Arbitrary, Unstructured};
29093 let mut buf = [0u8; 1024];
29094 rng.fill_bytes(&mut buf);
29095 let mut unstructured = Unstructured::new(&buf);
29096 Self::arbitrary(&mut unstructured).unwrap_or_default()
29097 }
29098}
29099impl Default for TERRAIN_REPORT_DATA {
29100 fn default() -> Self {
29101 Self::DEFAULT.clone()
29102 }
29103}
29104impl MessageData for TERRAIN_REPORT_DATA {
29105 type Message = MavMessage;
29106 const ID: u32 = 136u32;
29107 const NAME: &'static str = "TERRAIN_REPORT";
29108 const EXTRA_CRC: u8 = 1u8;
29109 const ENCODED_LEN: usize = 22usize;
29110 fn deser(
29111 _version: MavlinkVersion,
29112 __input: &[u8],
29113 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29114 let avail_len = __input.len();
29115 let mut payload_buf = [0; Self::ENCODED_LEN];
29116 let mut buf = if avail_len < Self::ENCODED_LEN {
29117 payload_buf[0..avail_len].copy_from_slice(__input);
29118 Bytes::new(&payload_buf)
29119 } else {
29120 Bytes::new(__input)
29121 };
29122 let mut __struct = Self::default();
29123 __struct.lat = buf.get_i32_le();
29124 __struct.lon = buf.get_i32_le();
29125 __struct.terrain_height = buf.get_f32_le();
29126 __struct.current_height = buf.get_f32_le();
29127 __struct.spacing = buf.get_u16_le();
29128 __struct.pending = buf.get_u16_le();
29129 __struct.loaded = buf.get_u16_le();
29130 Ok(__struct)
29131 }
29132 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29133 let mut __tmp = BytesMut::new(bytes);
29134 #[allow(clippy::absurd_extreme_comparisons)]
29135 #[allow(unused_comparisons)]
29136 if __tmp.remaining() < Self::ENCODED_LEN {
29137 panic!(
29138 "buffer is too small (need {} bytes, but got {})",
29139 Self::ENCODED_LEN,
29140 __tmp.remaining(),
29141 )
29142 }
29143 __tmp.put_i32_le(self.lat);
29144 __tmp.put_i32_le(self.lon);
29145 __tmp.put_f32_le(self.terrain_height);
29146 __tmp.put_f32_le(self.current_height);
29147 __tmp.put_u16_le(self.spacing);
29148 __tmp.put_u16_le(self.pending);
29149 __tmp.put_u16_le(self.loaded);
29150 if matches!(version, MavlinkVersion::V2) {
29151 let len = __tmp.len();
29152 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29153 } else {
29154 __tmp.len()
29155 }
29156 }
29157}
29158#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29159#[doc = ""]
29160#[doc = "ID: 133"]
29161#[derive(Debug, Clone, PartialEq)]
29162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29163#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29164pub struct TERRAIN_REQUEST_DATA {
29165 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
29166 pub mask: u64,
29167 #[doc = "Latitude of SW corner of first grid"]
29168 pub lat: i32,
29169 #[doc = "Longitude of SW corner of first grid"]
29170 pub lon: i32,
29171 #[doc = "Grid spacing"]
29172 pub grid_spacing: u16,
29173}
29174impl TERRAIN_REQUEST_DATA {
29175 pub const ENCODED_LEN: usize = 18usize;
29176 pub const DEFAULT: Self = Self {
29177 mask: 0_u64,
29178 lat: 0_i32,
29179 lon: 0_i32,
29180 grid_spacing: 0_u16,
29181 };
29182 #[cfg(feature = "arbitrary")]
29183 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29184 use arbitrary::{Arbitrary, Unstructured};
29185 let mut buf = [0u8; 1024];
29186 rng.fill_bytes(&mut buf);
29187 let mut unstructured = Unstructured::new(&buf);
29188 Self::arbitrary(&mut unstructured).unwrap_or_default()
29189 }
29190}
29191impl Default for TERRAIN_REQUEST_DATA {
29192 fn default() -> Self {
29193 Self::DEFAULT.clone()
29194 }
29195}
29196impl MessageData for TERRAIN_REQUEST_DATA {
29197 type Message = MavMessage;
29198 const ID: u32 = 133u32;
29199 const NAME: &'static str = "TERRAIN_REQUEST";
29200 const EXTRA_CRC: u8 = 6u8;
29201 const ENCODED_LEN: usize = 18usize;
29202 fn deser(
29203 _version: MavlinkVersion,
29204 __input: &[u8],
29205 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29206 let avail_len = __input.len();
29207 let mut payload_buf = [0; Self::ENCODED_LEN];
29208 let mut buf = if avail_len < Self::ENCODED_LEN {
29209 payload_buf[0..avail_len].copy_from_slice(__input);
29210 Bytes::new(&payload_buf)
29211 } else {
29212 Bytes::new(__input)
29213 };
29214 let mut __struct = Self::default();
29215 __struct.mask = buf.get_u64_le();
29216 __struct.lat = buf.get_i32_le();
29217 __struct.lon = buf.get_i32_le();
29218 __struct.grid_spacing = buf.get_u16_le();
29219 Ok(__struct)
29220 }
29221 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29222 let mut __tmp = BytesMut::new(bytes);
29223 #[allow(clippy::absurd_extreme_comparisons)]
29224 #[allow(unused_comparisons)]
29225 if __tmp.remaining() < Self::ENCODED_LEN {
29226 panic!(
29227 "buffer is too small (need {} bytes, but got {})",
29228 Self::ENCODED_LEN,
29229 __tmp.remaining(),
29230 )
29231 }
29232 __tmp.put_u64_le(self.mask);
29233 __tmp.put_i32_le(self.lat);
29234 __tmp.put_i32_le(self.lon);
29235 __tmp.put_u16_le(self.grid_spacing);
29236 if matches!(version, MavlinkVersion::V2) {
29237 let len = __tmp.len();
29238 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29239 } else {
29240 __tmp.len()
29241 }
29242 }
29243}
29244#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
29245#[doc = ""]
29246#[doc = "ID: 111"]
29247#[derive(Debug, Clone, PartialEq)]
29248#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29249#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29250pub struct TIMESYNC_DATA {
29251 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
29252 pub tc1: i64,
29253 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
29254 pub ts1: i64,
29255 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
29256 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29257 pub target_system: u8,
29258 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
29259 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29260 pub target_component: u8,
29261}
29262impl TIMESYNC_DATA {
29263 pub const ENCODED_LEN: usize = 18usize;
29264 pub const DEFAULT: Self = Self {
29265 tc1: 0_i64,
29266 ts1: 0_i64,
29267 target_system: 0_u8,
29268 target_component: 0_u8,
29269 };
29270 #[cfg(feature = "arbitrary")]
29271 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29272 use arbitrary::{Arbitrary, Unstructured};
29273 let mut buf = [0u8; 1024];
29274 rng.fill_bytes(&mut buf);
29275 let mut unstructured = Unstructured::new(&buf);
29276 Self::arbitrary(&mut unstructured).unwrap_or_default()
29277 }
29278}
29279impl Default for TIMESYNC_DATA {
29280 fn default() -> Self {
29281 Self::DEFAULT.clone()
29282 }
29283}
29284impl MessageData for TIMESYNC_DATA {
29285 type Message = MavMessage;
29286 const ID: u32 = 111u32;
29287 const NAME: &'static str = "TIMESYNC";
29288 const EXTRA_CRC: u8 = 34u8;
29289 const ENCODED_LEN: usize = 18usize;
29290 fn deser(
29291 _version: MavlinkVersion,
29292 __input: &[u8],
29293 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29294 let avail_len = __input.len();
29295 let mut payload_buf = [0; Self::ENCODED_LEN];
29296 let mut buf = if avail_len < Self::ENCODED_LEN {
29297 payload_buf[0..avail_len].copy_from_slice(__input);
29298 Bytes::new(&payload_buf)
29299 } else {
29300 Bytes::new(__input)
29301 };
29302 let mut __struct = Self::default();
29303 __struct.tc1 = buf.get_i64_le();
29304 __struct.ts1 = buf.get_i64_le();
29305 __struct.target_system = buf.get_u8();
29306 __struct.target_component = buf.get_u8();
29307 Ok(__struct)
29308 }
29309 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29310 let mut __tmp = BytesMut::new(bytes);
29311 #[allow(clippy::absurd_extreme_comparisons)]
29312 #[allow(unused_comparisons)]
29313 if __tmp.remaining() < Self::ENCODED_LEN {
29314 panic!(
29315 "buffer is too small (need {} bytes, but got {})",
29316 Self::ENCODED_LEN,
29317 __tmp.remaining(),
29318 )
29319 }
29320 __tmp.put_i64_le(self.tc1);
29321 __tmp.put_i64_le(self.ts1);
29322 if matches!(version, MavlinkVersion::V2) {
29323 __tmp.put_u8(self.target_system);
29324 __tmp.put_u8(self.target_component);
29325 let len = __tmp.len();
29326 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29327 } else {
29328 __tmp.len()
29329 }
29330 }
29331}
29332#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
29333#[doc = ""]
29334#[doc = "ID: 380"]
29335#[derive(Debug, Clone, PartialEq)]
29336#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29337#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29338pub struct TIME_ESTIMATE_TO_TARGET_DATA {
29339 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
29340 pub safe_return: i32,
29341 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
29342 pub land: i32,
29343 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
29344 pub mission_next_item: i32,
29345 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
29346 pub mission_end: i32,
29347 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
29348 pub commanded_action: i32,
29349}
29350impl TIME_ESTIMATE_TO_TARGET_DATA {
29351 pub const ENCODED_LEN: usize = 20usize;
29352 pub const DEFAULT: Self = Self {
29353 safe_return: 0_i32,
29354 land: 0_i32,
29355 mission_next_item: 0_i32,
29356 mission_end: 0_i32,
29357 commanded_action: 0_i32,
29358 };
29359 #[cfg(feature = "arbitrary")]
29360 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29361 use arbitrary::{Arbitrary, Unstructured};
29362 let mut buf = [0u8; 1024];
29363 rng.fill_bytes(&mut buf);
29364 let mut unstructured = Unstructured::new(&buf);
29365 Self::arbitrary(&mut unstructured).unwrap_or_default()
29366 }
29367}
29368impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
29369 fn default() -> Self {
29370 Self::DEFAULT.clone()
29371 }
29372}
29373impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
29374 type Message = MavMessage;
29375 const ID: u32 = 380u32;
29376 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
29377 const EXTRA_CRC: u8 = 232u8;
29378 const ENCODED_LEN: usize = 20usize;
29379 fn deser(
29380 _version: MavlinkVersion,
29381 __input: &[u8],
29382 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29383 let avail_len = __input.len();
29384 let mut payload_buf = [0; Self::ENCODED_LEN];
29385 let mut buf = if avail_len < Self::ENCODED_LEN {
29386 payload_buf[0..avail_len].copy_from_slice(__input);
29387 Bytes::new(&payload_buf)
29388 } else {
29389 Bytes::new(__input)
29390 };
29391 let mut __struct = Self::default();
29392 __struct.safe_return = buf.get_i32_le();
29393 __struct.land = buf.get_i32_le();
29394 __struct.mission_next_item = buf.get_i32_le();
29395 __struct.mission_end = buf.get_i32_le();
29396 __struct.commanded_action = buf.get_i32_le();
29397 Ok(__struct)
29398 }
29399 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29400 let mut __tmp = BytesMut::new(bytes);
29401 #[allow(clippy::absurd_extreme_comparisons)]
29402 #[allow(unused_comparisons)]
29403 if __tmp.remaining() < Self::ENCODED_LEN {
29404 panic!(
29405 "buffer is too small (need {} bytes, but got {})",
29406 Self::ENCODED_LEN,
29407 __tmp.remaining(),
29408 )
29409 }
29410 __tmp.put_i32_le(self.safe_return);
29411 __tmp.put_i32_le(self.land);
29412 __tmp.put_i32_le(self.mission_next_item);
29413 __tmp.put_i32_le(self.mission_end);
29414 __tmp.put_i32_le(self.commanded_action);
29415 if matches!(version, MavlinkVersion::V2) {
29416 let len = __tmp.len();
29417 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29418 } else {
29419 __tmp.len()
29420 }
29421 }
29422}
29423#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
29424#[doc = ""]
29425#[doc = "ID: 333"]
29426#[derive(Debug, Clone, PartialEq)]
29427#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29428#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29429pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29430 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29431 pub time_usec: u64,
29432 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
29433 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29434 pub pos_x: [f32; 5],
29435 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
29436 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29437 pub pos_y: [f32; 5],
29438 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
29439 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29440 pub pos_z: [f32; 5],
29441 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
29442 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29443 pub delta: [f32; 5],
29444 #[doc = "Yaw. Set to NaN for unchanged"]
29445 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29446 pub pos_yaw: [f32; 5],
29447 #[doc = "Number of valid control points (up-to 5 points are possible)"]
29448 pub valid_points: u8,
29449}
29450impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29451 pub const ENCODED_LEN: usize = 109usize;
29452 pub const DEFAULT: Self = Self {
29453 time_usec: 0_u64,
29454 pos_x: [0.0_f32; 5usize],
29455 pos_y: [0.0_f32; 5usize],
29456 pos_z: [0.0_f32; 5usize],
29457 delta: [0.0_f32; 5usize],
29458 pos_yaw: [0.0_f32; 5usize],
29459 valid_points: 0_u8,
29460 };
29461 #[cfg(feature = "arbitrary")]
29462 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29463 use arbitrary::{Arbitrary, Unstructured};
29464 let mut buf = [0u8; 1024];
29465 rng.fill_bytes(&mut buf);
29466 let mut unstructured = Unstructured::new(&buf);
29467 Self::arbitrary(&mut unstructured).unwrap_or_default()
29468 }
29469}
29470impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29471 fn default() -> Self {
29472 Self::DEFAULT.clone()
29473 }
29474}
29475impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29476 type Message = MavMessage;
29477 const ID: u32 = 333u32;
29478 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
29479 const EXTRA_CRC: u8 = 231u8;
29480 const ENCODED_LEN: usize = 109usize;
29481 fn deser(
29482 _version: MavlinkVersion,
29483 __input: &[u8],
29484 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29485 let avail_len = __input.len();
29486 let mut payload_buf = [0; Self::ENCODED_LEN];
29487 let mut buf = if avail_len < Self::ENCODED_LEN {
29488 payload_buf[0..avail_len].copy_from_slice(__input);
29489 Bytes::new(&payload_buf)
29490 } else {
29491 Bytes::new(__input)
29492 };
29493 let mut __struct = Self::default();
29494 __struct.time_usec = buf.get_u64_le();
29495 for v in &mut __struct.pos_x {
29496 let val = buf.get_f32_le();
29497 *v = val;
29498 }
29499 for v in &mut __struct.pos_y {
29500 let val = buf.get_f32_le();
29501 *v = val;
29502 }
29503 for v in &mut __struct.pos_z {
29504 let val = buf.get_f32_le();
29505 *v = val;
29506 }
29507 for v in &mut __struct.delta {
29508 let val = buf.get_f32_le();
29509 *v = val;
29510 }
29511 for v in &mut __struct.pos_yaw {
29512 let val = buf.get_f32_le();
29513 *v = val;
29514 }
29515 __struct.valid_points = buf.get_u8();
29516 Ok(__struct)
29517 }
29518 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29519 let mut __tmp = BytesMut::new(bytes);
29520 #[allow(clippy::absurd_extreme_comparisons)]
29521 #[allow(unused_comparisons)]
29522 if __tmp.remaining() < Self::ENCODED_LEN {
29523 panic!(
29524 "buffer is too small (need {} bytes, but got {})",
29525 Self::ENCODED_LEN,
29526 __tmp.remaining(),
29527 )
29528 }
29529 __tmp.put_u64_le(self.time_usec);
29530 for val in &self.pos_x {
29531 __tmp.put_f32_le(*val);
29532 }
29533 for val in &self.pos_y {
29534 __tmp.put_f32_le(*val);
29535 }
29536 for val in &self.pos_z {
29537 __tmp.put_f32_le(*val);
29538 }
29539 for val in &self.delta {
29540 __tmp.put_f32_le(*val);
29541 }
29542 for val in &self.pos_yaw {
29543 __tmp.put_f32_le(*val);
29544 }
29545 __tmp.put_u8(self.valid_points);
29546 if matches!(version, MavlinkVersion::V2) {
29547 let len = __tmp.len();
29548 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29549 } else {
29550 __tmp.len()
29551 }
29552 }
29553}
29554#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
29555#[doc = ""]
29556#[doc = "ID: 332"]
29557#[derive(Debug, Clone, PartialEq)]
29558#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29559#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29560pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29561 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29562 pub time_usec: u64,
29563 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
29564 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29565 pub pos_x: [f32; 5],
29566 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
29567 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29568 pub pos_y: [f32; 5],
29569 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
29570 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29571 pub pos_z: [f32; 5],
29572 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
29573 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29574 pub vel_x: [f32; 5],
29575 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
29576 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29577 pub vel_y: [f32; 5],
29578 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
29579 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29580 pub vel_z: [f32; 5],
29581 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
29582 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29583 pub acc_x: [f32; 5],
29584 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
29585 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29586 pub acc_y: [f32; 5],
29587 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
29588 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29589 pub acc_z: [f32; 5],
29590 #[doc = "Yaw angle, set to NaN if not being used"]
29591 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29592 pub pos_yaw: [f32; 5],
29593 #[doc = "Yaw rate, set to NaN if not being used"]
29594 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29595 pub vel_yaw: [f32; 5],
29596 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
29597 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29598 pub command: [u16; 5],
29599 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
29600 pub valid_points: u8,
29601}
29602impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29603 pub const ENCODED_LEN: usize = 239usize;
29604 pub const DEFAULT: Self = Self {
29605 time_usec: 0_u64,
29606 pos_x: [0.0_f32; 5usize],
29607 pos_y: [0.0_f32; 5usize],
29608 pos_z: [0.0_f32; 5usize],
29609 vel_x: [0.0_f32; 5usize],
29610 vel_y: [0.0_f32; 5usize],
29611 vel_z: [0.0_f32; 5usize],
29612 acc_x: [0.0_f32; 5usize],
29613 acc_y: [0.0_f32; 5usize],
29614 acc_z: [0.0_f32; 5usize],
29615 pos_yaw: [0.0_f32; 5usize],
29616 vel_yaw: [0.0_f32; 5usize],
29617 command: [0_u16; 5usize],
29618 valid_points: 0_u8,
29619 };
29620 #[cfg(feature = "arbitrary")]
29621 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29622 use arbitrary::{Arbitrary, Unstructured};
29623 let mut buf = [0u8; 1024];
29624 rng.fill_bytes(&mut buf);
29625 let mut unstructured = Unstructured::new(&buf);
29626 Self::arbitrary(&mut unstructured).unwrap_or_default()
29627 }
29628}
29629impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29630 fn default() -> Self {
29631 Self::DEFAULT.clone()
29632 }
29633}
29634impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29635 type Message = MavMessage;
29636 const ID: u32 = 332u32;
29637 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
29638 const EXTRA_CRC: u8 = 236u8;
29639 const ENCODED_LEN: usize = 239usize;
29640 fn deser(
29641 _version: MavlinkVersion,
29642 __input: &[u8],
29643 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29644 let avail_len = __input.len();
29645 let mut payload_buf = [0; Self::ENCODED_LEN];
29646 let mut buf = if avail_len < Self::ENCODED_LEN {
29647 payload_buf[0..avail_len].copy_from_slice(__input);
29648 Bytes::new(&payload_buf)
29649 } else {
29650 Bytes::new(__input)
29651 };
29652 let mut __struct = Self::default();
29653 __struct.time_usec = buf.get_u64_le();
29654 for v in &mut __struct.pos_x {
29655 let val = buf.get_f32_le();
29656 *v = val;
29657 }
29658 for v in &mut __struct.pos_y {
29659 let val = buf.get_f32_le();
29660 *v = val;
29661 }
29662 for v in &mut __struct.pos_z {
29663 let val = buf.get_f32_le();
29664 *v = val;
29665 }
29666 for v in &mut __struct.vel_x {
29667 let val = buf.get_f32_le();
29668 *v = val;
29669 }
29670 for v in &mut __struct.vel_y {
29671 let val = buf.get_f32_le();
29672 *v = val;
29673 }
29674 for v in &mut __struct.vel_z {
29675 let val = buf.get_f32_le();
29676 *v = val;
29677 }
29678 for v in &mut __struct.acc_x {
29679 let val = buf.get_f32_le();
29680 *v = val;
29681 }
29682 for v in &mut __struct.acc_y {
29683 let val = buf.get_f32_le();
29684 *v = val;
29685 }
29686 for v in &mut __struct.acc_z {
29687 let val = buf.get_f32_le();
29688 *v = val;
29689 }
29690 for v in &mut __struct.pos_yaw {
29691 let val = buf.get_f32_le();
29692 *v = val;
29693 }
29694 for v in &mut __struct.vel_yaw {
29695 let val = buf.get_f32_le();
29696 *v = val;
29697 }
29698 for v in &mut __struct.command {
29699 let val = buf.get_u16_le();
29700 *v = val;
29701 }
29702 __struct.valid_points = buf.get_u8();
29703 Ok(__struct)
29704 }
29705 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29706 let mut __tmp = BytesMut::new(bytes);
29707 #[allow(clippy::absurd_extreme_comparisons)]
29708 #[allow(unused_comparisons)]
29709 if __tmp.remaining() < Self::ENCODED_LEN {
29710 panic!(
29711 "buffer is too small (need {} bytes, but got {})",
29712 Self::ENCODED_LEN,
29713 __tmp.remaining(),
29714 )
29715 }
29716 __tmp.put_u64_le(self.time_usec);
29717 for val in &self.pos_x {
29718 __tmp.put_f32_le(*val);
29719 }
29720 for val in &self.pos_y {
29721 __tmp.put_f32_le(*val);
29722 }
29723 for val in &self.pos_z {
29724 __tmp.put_f32_le(*val);
29725 }
29726 for val in &self.vel_x {
29727 __tmp.put_f32_le(*val);
29728 }
29729 for val in &self.vel_y {
29730 __tmp.put_f32_le(*val);
29731 }
29732 for val in &self.vel_z {
29733 __tmp.put_f32_le(*val);
29734 }
29735 for val in &self.acc_x {
29736 __tmp.put_f32_le(*val);
29737 }
29738 for val in &self.acc_y {
29739 __tmp.put_f32_le(*val);
29740 }
29741 for val in &self.acc_z {
29742 __tmp.put_f32_le(*val);
29743 }
29744 for val in &self.pos_yaw {
29745 __tmp.put_f32_le(*val);
29746 }
29747 for val in &self.vel_yaw {
29748 __tmp.put_f32_le(*val);
29749 }
29750 for val in &self.command {
29751 __tmp.put_u16_le(*val);
29752 }
29753 __tmp.put_u8(self.valid_points);
29754 if matches!(version, MavlinkVersion::V2) {
29755 let len = __tmp.len();
29756 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29757 } else {
29758 __tmp.len()
29759 }
29760 }
29761}
29762#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
29763#[doc = ""]
29764#[doc = "ID: 385"]
29765#[derive(Debug, Clone, PartialEq)]
29766#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29767#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29768pub struct TUNNEL_DATA {
29769 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
29770 pub payload_type: MavTunnelPayloadType,
29771 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
29772 pub target_system: u8,
29773 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
29774 pub target_component: u8,
29775 #[doc = "Length of the data transported in payload"]
29776 pub payload_length: u8,
29777 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
29778 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29779 pub payload: [u8; 128],
29780}
29781impl TUNNEL_DATA {
29782 pub const ENCODED_LEN: usize = 133usize;
29783 pub const DEFAULT: Self = Self {
29784 payload_type: MavTunnelPayloadType::DEFAULT,
29785 target_system: 0_u8,
29786 target_component: 0_u8,
29787 payload_length: 0_u8,
29788 payload: [0_u8; 128usize],
29789 };
29790 #[cfg(feature = "arbitrary")]
29791 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29792 use arbitrary::{Arbitrary, Unstructured};
29793 let mut buf = [0u8; 1024];
29794 rng.fill_bytes(&mut buf);
29795 let mut unstructured = Unstructured::new(&buf);
29796 Self::arbitrary(&mut unstructured).unwrap_or_default()
29797 }
29798}
29799impl Default for TUNNEL_DATA {
29800 fn default() -> Self {
29801 Self::DEFAULT.clone()
29802 }
29803}
29804impl MessageData for TUNNEL_DATA {
29805 type Message = MavMessage;
29806 const ID: u32 = 385u32;
29807 const NAME: &'static str = "TUNNEL";
29808 const EXTRA_CRC: u8 = 147u8;
29809 const ENCODED_LEN: usize = 133usize;
29810 fn deser(
29811 _version: MavlinkVersion,
29812 __input: &[u8],
29813 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29814 let avail_len = __input.len();
29815 let mut payload_buf = [0; Self::ENCODED_LEN];
29816 let mut buf = if avail_len < Self::ENCODED_LEN {
29817 payload_buf[0..avail_len].copy_from_slice(__input);
29818 Bytes::new(&payload_buf)
29819 } else {
29820 Bytes::new(__input)
29821 };
29822 let mut __struct = Self::default();
29823 let tmp = buf.get_u16_le();
29824 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
29825 ::mavlink_core::error::ParserError::InvalidEnum {
29826 enum_type: "MavTunnelPayloadType",
29827 value: tmp as u32,
29828 },
29829 )?;
29830 __struct.target_system = buf.get_u8();
29831 __struct.target_component = buf.get_u8();
29832 __struct.payload_length = buf.get_u8();
29833 for v in &mut __struct.payload {
29834 let val = buf.get_u8();
29835 *v = val;
29836 }
29837 Ok(__struct)
29838 }
29839 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29840 let mut __tmp = BytesMut::new(bytes);
29841 #[allow(clippy::absurd_extreme_comparisons)]
29842 #[allow(unused_comparisons)]
29843 if __tmp.remaining() < Self::ENCODED_LEN {
29844 panic!(
29845 "buffer is too small (need {} bytes, but got {})",
29846 Self::ENCODED_LEN,
29847 __tmp.remaining(),
29848 )
29849 }
29850 __tmp.put_u16_le(self.payload_type as u16);
29851 __tmp.put_u8(self.target_system);
29852 __tmp.put_u8(self.target_component);
29853 __tmp.put_u8(self.payload_length);
29854 for val in &self.payload {
29855 __tmp.put_u8(*val);
29856 }
29857 if matches!(version, MavlinkVersion::V2) {
29858 let len = __tmp.len();
29859 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29860 } else {
29861 __tmp.len()
29862 }
29863 }
29864}
29865#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
29866#[doc = ""]
29867#[doc = "ID: 311"]
29868#[derive(Debug, Clone, PartialEq)]
29869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29870#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29871pub struct UAVCAN_NODE_INFO_DATA {
29872 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29873 pub time_usec: u64,
29874 #[doc = "Time since the start-up of the node."]
29875 pub uptime_sec: u32,
29876 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
29877 pub sw_vcs_commit: u32,
29878 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
29879 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29880 pub name: [u8; 80],
29881 #[doc = "Hardware major version number."]
29882 pub hw_version_major: u8,
29883 #[doc = "Hardware minor version number."]
29884 pub hw_version_minor: u8,
29885 #[doc = "Hardware unique 128-bit ID."]
29886 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29887 pub hw_unique_id: [u8; 16],
29888 #[doc = "Software major version number."]
29889 pub sw_version_major: u8,
29890 #[doc = "Software minor version number."]
29891 pub sw_version_minor: u8,
29892}
29893impl UAVCAN_NODE_INFO_DATA {
29894 pub const ENCODED_LEN: usize = 116usize;
29895 pub const DEFAULT: Self = Self {
29896 time_usec: 0_u64,
29897 uptime_sec: 0_u32,
29898 sw_vcs_commit: 0_u32,
29899 name: [0_u8; 80usize],
29900 hw_version_major: 0_u8,
29901 hw_version_minor: 0_u8,
29902 hw_unique_id: [0_u8; 16usize],
29903 sw_version_major: 0_u8,
29904 sw_version_minor: 0_u8,
29905 };
29906 #[cfg(feature = "arbitrary")]
29907 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29908 use arbitrary::{Arbitrary, Unstructured};
29909 let mut buf = [0u8; 1024];
29910 rng.fill_bytes(&mut buf);
29911 let mut unstructured = Unstructured::new(&buf);
29912 Self::arbitrary(&mut unstructured).unwrap_or_default()
29913 }
29914}
29915impl Default for UAVCAN_NODE_INFO_DATA {
29916 fn default() -> Self {
29917 Self::DEFAULT.clone()
29918 }
29919}
29920impl MessageData for UAVCAN_NODE_INFO_DATA {
29921 type Message = MavMessage;
29922 const ID: u32 = 311u32;
29923 const NAME: &'static str = "UAVCAN_NODE_INFO";
29924 const EXTRA_CRC: u8 = 95u8;
29925 const ENCODED_LEN: usize = 116usize;
29926 fn deser(
29927 _version: MavlinkVersion,
29928 __input: &[u8],
29929 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29930 let avail_len = __input.len();
29931 let mut payload_buf = [0; Self::ENCODED_LEN];
29932 let mut buf = if avail_len < Self::ENCODED_LEN {
29933 payload_buf[0..avail_len].copy_from_slice(__input);
29934 Bytes::new(&payload_buf)
29935 } else {
29936 Bytes::new(__input)
29937 };
29938 let mut __struct = Self::default();
29939 __struct.time_usec = buf.get_u64_le();
29940 __struct.uptime_sec = buf.get_u32_le();
29941 __struct.sw_vcs_commit = buf.get_u32_le();
29942 for v in &mut __struct.name {
29943 let val = buf.get_u8();
29944 *v = val;
29945 }
29946 __struct.hw_version_major = buf.get_u8();
29947 __struct.hw_version_minor = buf.get_u8();
29948 for v in &mut __struct.hw_unique_id {
29949 let val = buf.get_u8();
29950 *v = val;
29951 }
29952 __struct.sw_version_major = buf.get_u8();
29953 __struct.sw_version_minor = buf.get_u8();
29954 Ok(__struct)
29955 }
29956 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29957 let mut __tmp = BytesMut::new(bytes);
29958 #[allow(clippy::absurd_extreme_comparisons)]
29959 #[allow(unused_comparisons)]
29960 if __tmp.remaining() < Self::ENCODED_LEN {
29961 panic!(
29962 "buffer is too small (need {} bytes, but got {})",
29963 Self::ENCODED_LEN,
29964 __tmp.remaining(),
29965 )
29966 }
29967 __tmp.put_u64_le(self.time_usec);
29968 __tmp.put_u32_le(self.uptime_sec);
29969 __tmp.put_u32_le(self.sw_vcs_commit);
29970 for val in &self.name {
29971 __tmp.put_u8(*val);
29972 }
29973 __tmp.put_u8(self.hw_version_major);
29974 __tmp.put_u8(self.hw_version_minor);
29975 for val in &self.hw_unique_id {
29976 __tmp.put_u8(*val);
29977 }
29978 __tmp.put_u8(self.sw_version_major);
29979 __tmp.put_u8(self.sw_version_minor);
29980 if matches!(version, MavlinkVersion::V2) {
29981 let len = __tmp.len();
29982 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29983 } else {
29984 __tmp.len()
29985 }
29986 }
29987}
29988#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
29989#[doc = ""]
29990#[doc = "ID: 310"]
29991#[derive(Debug, Clone, PartialEq)]
29992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29993#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29994pub struct UAVCAN_NODE_STATUS_DATA {
29995 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29996 pub time_usec: u64,
29997 #[doc = "Time since the start-up of the node."]
29998 pub uptime_sec: u32,
29999 #[doc = "Vendor-specific status information."]
30000 pub vendor_specific_status_code: u16,
30001 #[doc = "Generalized node health status."]
30002 pub health: UavcanNodeHealth,
30003 #[doc = "Generalized operating mode."]
30004 pub mode: UavcanNodeMode,
30005 #[doc = "Not used currently."]
30006 pub sub_mode: u8,
30007}
30008impl UAVCAN_NODE_STATUS_DATA {
30009 pub const ENCODED_LEN: usize = 17usize;
30010 pub const DEFAULT: Self = Self {
30011 time_usec: 0_u64,
30012 uptime_sec: 0_u32,
30013 vendor_specific_status_code: 0_u16,
30014 health: UavcanNodeHealth::DEFAULT,
30015 mode: UavcanNodeMode::DEFAULT,
30016 sub_mode: 0_u8,
30017 };
30018 #[cfg(feature = "arbitrary")]
30019 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30020 use arbitrary::{Arbitrary, Unstructured};
30021 let mut buf = [0u8; 1024];
30022 rng.fill_bytes(&mut buf);
30023 let mut unstructured = Unstructured::new(&buf);
30024 Self::arbitrary(&mut unstructured).unwrap_or_default()
30025 }
30026}
30027impl Default for UAVCAN_NODE_STATUS_DATA {
30028 fn default() -> Self {
30029 Self::DEFAULT.clone()
30030 }
30031}
30032impl MessageData for UAVCAN_NODE_STATUS_DATA {
30033 type Message = MavMessage;
30034 const ID: u32 = 310u32;
30035 const NAME: &'static str = "UAVCAN_NODE_STATUS";
30036 const EXTRA_CRC: u8 = 28u8;
30037 const ENCODED_LEN: usize = 17usize;
30038 fn deser(
30039 _version: MavlinkVersion,
30040 __input: &[u8],
30041 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30042 let avail_len = __input.len();
30043 let mut payload_buf = [0; Self::ENCODED_LEN];
30044 let mut buf = if avail_len < Self::ENCODED_LEN {
30045 payload_buf[0..avail_len].copy_from_slice(__input);
30046 Bytes::new(&payload_buf)
30047 } else {
30048 Bytes::new(__input)
30049 };
30050 let mut __struct = Self::default();
30051 __struct.time_usec = buf.get_u64_le();
30052 __struct.uptime_sec = buf.get_u32_le();
30053 __struct.vendor_specific_status_code = buf.get_u16_le();
30054 let tmp = buf.get_u8();
30055 __struct.health =
30056 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30057 enum_type: "UavcanNodeHealth",
30058 value: tmp as u32,
30059 })?;
30060 let tmp = buf.get_u8();
30061 __struct.mode =
30062 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30063 enum_type: "UavcanNodeMode",
30064 value: tmp as u32,
30065 })?;
30066 __struct.sub_mode = buf.get_u8();
30067 Ok(__struct)
30068 }
30069 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30070 let mut __tmp = BytesMut::new(bytes);
30071 #[allow(clippy::absurd_extreme_comparisons)]
30072 #[allow(unused_comparisons)]
30073 if __tmp.remaining() < Self::ENCODED_LEN {
30074 panic!(
30075 "buffer is too small (need {} bytes, but got {})",
30076 Self::ENCODED_LEN,
30077 __tmp.remaining(),
30078 )
30079 }
30080 __tmp.put_u64_le(self.time_usec);
30081 __tmp.put_u32_le(self.uptime_sec);
30082 __tmp.put_u16_le(self.vendor_specific_status_code);
30083 __tmp.put_u8(self.health as u8);
30084 __tmp.put_u8(self.mode as u8);
30085 __tmp.put_u8(self.sub_mode);
30086 if matches!(version, MavlinkVersion::V2) {
30087 let len = __tmp.len();
30088 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30089 } else {
30090 __tmp.len()
30091 }
30092 }
30093}
30094#[doc = "The global position resulting from GPS and sensor fusion."]
30095#[doc = ""]
30096#[doc = "ID: 340"]
30097#[derive(Debug, Clone, PartialEq)]
30098#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30099#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30100pub struct UTM_GLOBAL_POSITION_DATA {
30101 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
30102 pub time: u64,
30103 #[doc = "Latitude (WGS84)"]
30104 pub lat: i32,
30105 #[doc = "Longitude (WGS84)"]
30106 pub lon: i32,
30107 #[doc = "Altitude (WGS84)"]
30108 pub alt: i32,
30109 #[doc = "Altitude above ground"]
30110 pub relative_alt: i32,
30111 #[doc = "Next waypoint, latitude (WGS84)"]
30112 pub next_lat: i32,
30113 #[doc = "Next waypoint, longitude (WGS84)"]
30114 pub next_lon: i32,
30115 #[doc = "Next waypoint, altitude (WGS84)"]
30116 pub next_alt: i32,
30117 #[doc = "Ground X speed (latitude, positive north)"]
30118 pub vx: i16,
30119 #[doc = "Ground Y speed (longitude, positive east)"]
30120 pub vy: i16,
30121 #[doc = "Ground Z speed (altitude, positive down)"]
30122 pub vz: i16,
30123 #[doc = "Horizontal position uncertainty (standard deviation)"]
30124 pub h_acc: u16,
30125 #[doc = "Altitude uncertainty (standard deviation)"]
30126 pub v_acc: u16,
30127 #[doc = "Speed uncertainty (standard deviation)"]
30128 pub vel_acc: u16,
30129 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
30130 pub update_rate: u16,
30131 #[doc = "Unique UAS ID."]
30132 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30133 pub uas_id: [u8; 18],
30134 #[doc = "Flight state"]
30135 pub flight_state: UtmFlightState,
30136 #[doc = "Bitwise OR combination of the data available flags."]
30137 pub flags: UtmDataAvailFlags,
30138}
30139impl UTM_GLOBAL_POSITION_DATA {
30140 pub const ENCODED_LEN: usize = 70usize;
30141 pub const DEFAULT: Self = Self {
30142 time: 0_u64,
30143 lat: 0_i32,
30144 lon: 0_i32,
30145 alt: 0_i32,
30146 relative_alt: 0_i32,
30147 next_lat: 0_i32,
30148 next_lon: 0_i32,
30149 next_alt: 0_i32,
30150 vx: 0_i16,
30151 vy: 0_i16,
30152 vz: 0_i16,
30153 h_acc: 0_u16,
30154 v_acc: 0_u16,
30155 vel_acc: 0_u16,
30156 update_rate: 0_u16,
30157 uas_id: [0_u8; 18usize],
30158 flight_state: UtmFlightState::DEFAULT,
30159 flags: UtmDataAvailFlags::DEFAULT,
30160 };
30161 #[cfg(feature = "arbitrary")]
30162 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30163 use arbitrary::{Arbitrary, Unstructured};
30164 let mut buf = [0u8; 1024];
30165 rng.fill_bytes(&mut buf);
30166 let mut unstructured = Unstructured::new(&buf);
30167 Self::arbitrary(&mut unstructured).unwrap_or_default()
30168 }
30169}
30170impl Default for UTM_GLOBAL_POSITION_DATA {
30171 fn default() -> Self {
30172 Self::DEFAULT.clone()
30173 }
30174}
30175impl MessageData for UTM_GLOBAL_POSITION_DATA {
30176 type Message = MavMessage;
30177 const ID: u32 = 340u32;
30178 const NAME: &'static str = "UTM_GLOBAL_POSITION";
30179 const EXTRA_CRC: u8 = 99u8;
30180 const ENCODED_LEN: usize = 70usize;
30181 fn deser(
30182 _version: MavlinkVersion,
30183 __input: &[u8],
30184 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30185 let avail_len = __input.len();
30186 let mut payload_buf = [0; Self::ENCODED_LEN];
30187 let mut buf = if avail_len < Self::ENCODED_LEN {
30188 payload_buf[0..avail_len].copy_from_slice(__input);
30189 Bytes::new(&payload_buf)
30190 } else {
30191 Bytes::new(__input)
30192 };
30193 let mut __struct = Self::default();
30194 __struct.time = buf.get_u64_le();
30195 __struct.lat = buf.get_i32_le();
30196 __struct.lon = buf.get_i32_le();
30197 __struct.alt = buf.get_i32_le();
30198 __struct.relative_alt = buf.get_i32_le();
30199 __struct.next_lat = buf.get_i32_le();
30200 __struct.next_lon = buf.get_i32_le();
30201 __struct.next_alt = buf.get_i32_le();
30202 __struct.vx = buf.get_i16_le();
30203 __struct.vy = buf.get_i16_le();
30204 __struct.vz = buf.get_i16_le();
30205 __struct.h_acc = buf.get_u16_le();
30206 __struct.v_acc = buf.get_u16_le();
30207 __struct.vel_acc = buf.get_u16_le();
30208 __struct.update_rate = buf.get_u16_le();
30209 for v in &mut __struct.uas_id {
30210 let val = buf.get_u8();
30211 *v = val;
30212 }
30213 let tmp = buf.get_u8();
30214 __struct.flight_state =
30215 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30216 enum_type: "UtmFlightState",
30217 value: tmp as u32,
30218 })?;
30219 let tmp = buf.get_u8();
30220 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
30221 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30222 flag_type: "UtmDataAvailFlags",
30223 value: tmp as u32,
30224 })?;
30225 Ok(__struct)
30226 }
30227 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30228 let mut __tmp = BytesMut::new(bytes);
30229 #[allow(clippy::absurd_extreme_comparisons)]
30230 #[allow(unused_comparisons)]
30231 if __tmp.remaining() < Self::ENCODED_LEN {
30232 panic!(
30233 "buffer is too small (need {} bytes, but got {})",
30234 Self::ENCODED_LEN,
30235 __tmp.remaining(),
30236 )
30237 }
30238 __tmp.put_u64_le(self.time);
30239 __tmp.put_i32_le(self.lat);
30240 __tmp.put_i32_le(self.lon);
30241 __tmp.put_i32_le(self.alt);
30242 __tmp.put_i32_le(self.relative_alt);
30243 __tmp.put_i32_le(self.next_lat);
30244 __tmp.put_i32_le(self.next_lon);
30245 __tmp.put_i32_le(self.next_alt);
30246 __tmp.put_i16_le(self.vx);
30247 __tmp.put_i16_le(self.vy);
30248 __tmp.put_i16_le(self.vz);
30249 __tmp.put_u16_le(self.h_acc);
30250 __tmp.put_u16_le(self.v_acc);
30251 __tmp.put_u16_le(self.vel_acc);
30252 __tmp.put_u16_le(self.update_rate);
30253 for val in &self.uas_id {
30254 __tmp.put_u8(*val);
30255 }
30256 __tmp.put_u8(self.flight_state as u8);
30257 __tmp.put_u8(self.flags.bits());
30258 if matches!(version, MavlinkVersion::V2) {
30259 let len = __tmp.len();
30260 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30261 } else {
30262 __tmp.len()
30263 }
30264 }
30265}
30266#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
30267#[doc = ""]
30268#[doc = "ID: 248"]
30269#[derive(Debug, Clone, PartialEq)]
30270#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30271#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30272pub struct V2_EXTENSION_DATA {
30273 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30274 pub message_type: u16,
30275 #[doc = "Network ID (0 for broadcast)"]
30276 pub target_network: u8,
30277 #[doc = "System ID (0 for broadcast)"]
30278 pub target_system: u8,
30279 #[doc = "Component ID (0 for broadcast)"]
30280 pub target_component: u8,
30281 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
30282 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30283 pub payload: [u8; 249],
30284}
30285impl V2_EXTENSION_DATA {
30286 pub const ENCODED_LEN: usize = 254usize;
30287 pub const DEFAULT: Self = Self {
30288 message_type: 0_u16,
30289 target_network: 0_u8,
30290 target_system: 0_u8,
30291 target_component: 0_u8,
30292 payload: [0_u8; 249usize],
30293 };
30294 #[cfg(feature = "arbitrary")]
30295 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30296 use arbitrary::{Arbitrary, Unstructured};
30297 let mut buf = [0u8; 1024];
30298 rng.fill_bytes(&mut buf);
30299 let mut unstructured = Unstructured::new(&buf);
30300 Self::arbitrary(&mut unstructured).unwrap_or_default()
30301 }
30302}
30303impl Default for V2_EXTENSION_DATA {
30304 fn default() -> Self {
30305 Self::DEFAULT.clone()
30306 }
30307}
30308impl MessageData for V2_EXTENSION_DATA {
30309 type Message = MavMessage;
30310 const ID: u32 = 248u32;
30311 const NAME: &'static str = "V2_EXTENSION";
30312 const EXTRA_CRC: u8 = 8u8;
30313 const ENCODED_LEN: usize = 254usize;
30314 fn deser(
30315 _version: MavlinkVersion,
30316 __input: &[u8],
30317 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30318 let avail_len = __input.len();
30319 let mut payload_buf = [0; Self::ENCODED_LEN];
30320 let mut buf = if avail_len < Self::ENCODED_LEN {
30321 payload_buf[0..avail_len].copy_from_slice(__input);
30322 Bytes::new(&payload_buf)
30323 } else {
30324 Bytes::new(__input)
30325 };
30326 let mut __struct = Self::default();
30327 __struct.message_type = buf.get_u16_le();
30328 __struct.target_network = buf.get_u8();
30329 __struct.target_system = buf.get_u8();
30330 __struct.target_component = buf.get_u8();
30331 for v in &mut __struct.payload {
30332 let val = buf.get_u8();
30333 *v = val;
30334 }
30335 Ok(__struct)
30336 }
30337 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30338 let mut __tmp = BytesMut::new(bytes);
30339 #[allow(clippy::absurd_extreme_comparisons)]
30340 #[allow(unused_comparisons)]
30341 if __tmp.remaining() < Self::ENCODED_LEN {
30342 panic!(
30343 "buffer is too small (need {} bytes, but got {})",
30344 Self::ENCODED_LEN,
30345 __tmp.remaining(),
30346 )
30347 }
30348 __tmp.put_u16_le(self.message_type);
30349 __tmp.put_u8(self.target_network);
30350 __tmp.put_u8(self.target_system);
30351 __tmp.put_u8(self.target_component);
30352 for val in &self.payload {
30353 __tmp.put_u8(*val);
30354 }
30355 if matches!(version, MavlinkVersion::V2) {
30356 let len = __tmp.len();
30357 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30358 } else {
30359 __tmp.len()
30360 }
30361 }
30362}
30363#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
30364#[doc = ""]
30365#[doc = "ID: 74"]
30366#[derive(Debug, Clone, PartialEq)]
30367#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30368#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30369pub struct VFR_HUD_DATA {
30370 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
30371 pub airspeed: f32,
30372 #[doc = "Current ground speed."]
30373 pub groundspeed: f32,
30374 #[doc = "Current altitude (MSL)."]
30375 pub alt: f32,
30376 #[doc = "Current climb rate."]
30377 pub climb: f32,
30378 #[doc = "Current heading in compass units (0-360, 0=north)."]
30379 pub heading: i16,
30380 #[doc = "Current throttle setting (0 to 100)."]
30381 pub throttle: u16,
30382}
30383impl VFR_HUD_DATA {
30384 pub const ENCODED_LEN: usize = 20usize;
30385 pub const DEFAULT: Self = Self {
30386 airspeed: 0.0_f32,
30387 groundspeed: 0.0_f32,
30388 alt: 0.0_f32,
30389 climb: 0.0_f32,
30390 heading: 0_i16,
30391 throttle: 0_u16,
30392 };
30393 #[cfg(feature = "arbitrary")]
30394 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30395 use arbitrary::{Arbitrary, Unstructured};
30396 let mut buf = [0u8; 1024];
30397 rng.fill_bytes(&mut buf);
30398 let mut unstructured = Unstructured::new(&buf);
30399 Self::arbitrary(&mut unstructured).unwrap_or_default()
30400 }
30401}
30402impl Default for VFR_HUD_DATA {
30403 fn default() -> Self {
30404 Self::DEFAULT.clone()
30405 }
30406}
30407impl MessageData for VFR_HUD_DATA {
30408 type Message = MavMessage;
30409 const ID: u32 = 74u32;
30410 const NAME: &'static str = "VFR_HUD";
30411 const EXTRA_CRC: u8 = 20u8;
30412 const ENCODED_LEN: usize = 20usize;
30413 fn deser(
30414 _version: MavlinkVersion,
30415 __input: &[u8],
30416 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30417 let avail_len = __input.len();
30418 let mut payload_buf = [0; Self::ENCODED_LEN];
30419 let mut buf = if avail_len < Self::ENCODED_LEN {
30420 payload_buf[0..avail_len].copy_from_slice(__input);
30421 Bytes::new(&payload_buf)
30422 } else {
30423 Bytes::new(__input)
30424 };
30425 let mut __struct = Self::default();
30426 __struct.airspeed = buf.get_f32_le();
30427 __struct.groundspeed = buf.get_f32_le();
30428 __struct.alt = buf.get_f32_le();
30429 __struct.climb = buf.get_f32_le();
30430 __struct.heading = buf.get_i16_le();
30431 __struct.throttle = buf.get_u16_le();
30432 Ok(__struct)
30433 }
30434 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30435 let mut __tmp = BytesMut::new(bytes);
30436 #[allow(clippy::absurd_extreme_comparisons)]
30437 #[allow(unused_comparisons)]
30438 if __tmp.remaining() < Self::ENCODED_LEN {
30439 panic!(
30440 "buffer is too small (need {} bytes, but got {})",
30441 Self::ENCODED_LEN,
30442 __tmp.remaining(),
30443 )
30444 }
30445 __tmp.put_f32_le(self.airspeed);
30446 __tmp.put_f32_le(self.groundspeed);
30447 __tmp.put_f32_le(self.alt);
30448 __tmp.put_f32_le(self.climb);
30449 __tmp.put_i16_le(self.heading);
30450 __tmp.put_u16_le(self.throttle);
30451 if matches!(version, MavlinkVersion::V2) {
30452 let len = __tmp.len();
30453 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30454 } else {
30455 __tmp.len()
30456 }
30457 }
30458}
30459#[doc = "Vibration levels and accelerometer clipping."]
30460#[doc = ""]
30461#[doc = "ID: 241"]
30462#[derive(Debug, Clone, PartialEq)]
30463#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30464#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30465pub struct VIBRATION_DATA {
30466 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30467 pub time_usec: u64,
30468 #[doc = "Vibration levels on X-axis"]
30469 pub vibration_x: f32,
30470 #[doc = "Vibration levels on Y-axis"]
30471 pub vibration_y: f32,
30472 #[doc = "Vibration levels on Z-axis"]
30473 pub vibration_z: f32,
30474 #[doc = "first accelerometer clipping count"]
30475 pub clipping_0: u32,
30476 #[doc = "second accelerometer clipping count"]
30477 pub clipping_1: u32,
30478 #[doc = "third accelerometer clipping count"]
30479 pub clipping_2: u32,
30480}
30481impl VIBRATION_DATA {
30482 pub const ENCODED_LEN: usize = 32usize;
30483 pub const DEFAULT: Self = Self {
30484 time_usec: 0_u64,
30485 vibration_x: 0.0_f32,
30486 vibration_y: 0.0_f32,
30487 vibration_z: 0.0_f32,
30488 clipping_0: 0_u32,
30489 clipping_1: 0_u32,
30490 clipping_2: 0_u32,
30491 };
30492 #[cfg(feature = "arbitrary")]
30493 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30494 use arbitrary::{Arbitrary, Unstructured};
30495 let mut buf = [0u8; 1024];
30496 rng.fill_bytes(&mut buf);
30497 let mut unstructured = Unstructured::new(&buf);
30498 Self::arbitrary(&mut unstructured).unwrap_or_default()
30499 }
30500}
30501impl Default for VIBRATION_DATA {
30502 fn default() -> Self {
30503 Self::DEFAULT.clone()
30504 }
30505}
30506impl MessageData for VIBRATION_DATA {
30507 type Message = MavMessage;
30508 const ID: u32 = 241u32;
30509 const NAME: &'static str = "VIBRATION";
30510 const EXTRA_CRC: u8 = 90u8;
30511 const ENCODED_LEN: usize = 32usize;
30512 fn deser(
30513 _version: MavlinkVersion,
30514 __input: &[u8],
30515 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30516 let avail_len = __input.len();
30517 let mut payload_buf = [0; Self::ENCODED_LEN];
30518 let mut buf = if avail_len < Self::ENCODED_LEN {
30519 payload_buf[0..avail_len].copy_from_slice(__input);
30520 Bytes::new(&payload_buf)
30521 } else {
30522 Bytes::new(__input)
30523 };
30524 let mut __struct = Self::default();
30525 __struct.time_usec = buf.get_u64_le();
30526 __struct.vibration_x = buf.get_f32_le();
30527 __struct.vibration_y = buf.get_f32_le();
30528 __struct.vibration_z = buf.get_f32_le();
30529 __struct.clipping_0 = buf.get_u32_le();
30530 __struct.clipping_1 = buf.get_u32_le();
30531 __struct.clipping_2 = buf.get_u32_le();
30532 Ok(__struct)
30533 }
30534 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30535 let mut __tmp = BytesMut::new(bytes);
30536 #[allow(clippy::absurd_extreme_comparisons)]
30537 #[allow(unused_comparisons)]
30538 if __tmp.remaining() < Self::ENCODED_LEN {
30539 panic!(
30540 "buffer is too small (need {} bytes, but got {})",
30541 Self::ENCODED_LEN,
30542 __tmp.remaining(),
30543 )
30544 }
30545 __tmp.put_u64_le(self.time_usec);
30546 __tmp.put_f32_le(self.vibration_x);
30547 __tmp.put_f32_le(self.vibration_y);
30548 __tmp.put_f32_le(self.vibration_z);
30549 __tmp.put_u32_le(self.clipping_0);
30550 __tmp.put_u32_le(self.clipping_1);
30551 __tmp.put_u32_le(self.clipping_2);
30552 if matches!(version, MavlinkVersion::V2) {
30553 let len = __tmp.len();
30554 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30555 } else {
30556 __tmp.len()
30557 }
30558 }
30559}
30560#[doc = "Global position estimate from a Vicon motion system source."]
30561#[doc = ""]
30562#[doc = "ID: 104"]
30563#[derive(Debug, Clone, PartialEq)]
30564#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30565#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30566pub struct VICON_POSITION_ESTIMATE_DATA {
30567 #[doc = "Timestamp (UNIX time or time since system boot)"]
30568 pub usec: u64,
30569 #[doc = "Global X position"]
30570 pub x: f32,
30571 #[doc = "Global Y position"]
30572 pub y: f32,
30573 #[doc = "Global Z position"]
30574 pub z: f32,
30575 #[doc = "Roll angle"]
30576 pub roll: f32,
30577 #[doc = "Pitch angle"]
30578 pub pitch: f32,
30579 #[doc = "Yaw angle"]
30580 pub yaw: f32,
30581 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
30582 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30583 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30584 pub covariance: [f32; 21],
30585}
30586impl VICON_POSITION_ESTIMATE_DATA {
30587 pub const ENCODED_LEN: usize = 116usize;
30588 pub const DEFAULT: Self = Self {
30589 usec: 0_u64,
30590 x: 0.0_f32,
30591 y: 0.0_f32,
30592 z: 0.0_f32,
30593 roll: 0.0_f32,
30594 pitch: 0.0_f32,
30595 yaw: 0.0_f32,
30596 covariance: [0.0_f32; 21usize],
30597 };
30598 #[cfg(feature = "arbitrary")]
30599 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30600 use arbitrary::{Arbitrary, Unstructured};
30601 let mut buf = [0u8; 1024];
30602 rng.fill_bytes(&mut buf);
30603 let mut unstructured = Unstructured::new(&buf);
30604 Self::arbitrary(&mut unstructured).unwrap_or_default()
30605 }
30606}
30607impl Default for VICON_POSITION_ESTIMATE_DATA {
30608 fn default() -> Self {
30609 Self::DEFAULT.clone()
30610 }
30611}
30612impl MessageData for VICON_POSITION_ESTIMATE_DATA {
30613 type Message = MavMessage;
30614 const ID: u32 = 104u32;
30615 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
30616 const EXTRA_CRC: u8 = 56u8;
30617 const ENCODED_LEN: usize = 116usize;
30618 fn deser(
30619 _version: MavlinkVersion,
30620 __input: &[u8],
30621 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30622 let avail_len = __input.len();
30623 let mut payload_buf = [0; Self::ENCODED_LEN];
30624 let mut buf = if avail_len < Self::ENCODED_LEN {
30625 payload_buf[0..avail_len].copy_from_slice(__input);
30626 Bytes::new(&payload_buf)
30627 } else {
30628 Bytes::new(__input)
30629 };
30630 let mut __struct = Self::default();
30631 __struct.usec = buf.get_u64_le();
30632 __struct.x = buf.get_f32_le();
30633 __struct.y = buf.get_f32_le();
30634 __struct.z = buf.get_f32_le();
30635 __struct.roll = buf.get_f32_le();
30636 __struct.pitch = buf.get_f32_le();
30637 __struct.yaw = buf.get_f32_le();
30638 for v in &mut __struct.covariance {
30639 let val = buf.get_f32_le();
30640 *v = val;
30641 }
30642 Ok(__struct)
30643 }
30644 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30645 let mut __tmp = BytesMut::new(bytes);
30646 #[allow(clippy::absurd_extreme_comparisons)]
30647 #[allow(unused_comparisons)]
30648 if __tmp.remaining() < Self::ENCODED_LEN {
30649 panic!(
30650 "buffer is too small (need {} bytes, but got {})",
30651 Self::ENCODED_LEN,
30652 __tmp.remaining(),
30653 )
30654 }
30655 __tmp.put_u64_le(self.usec);
30656 __tmp.put_f32_le(self.x);
30657 __tmp.put_f32_le(self.y);
30658 __tmp.put_f32_le(self.z);
30659 __tmp.put_f32_le(self.roll);
30660 __tmp.put_f32_le(self.pitch);
30661 __tmp.put_f32_le(self.yaw);
30662 if matches!(version, MavlinkVersion::V2) {
30663 for val in &self.covariance {
30664 __tmp.put_f32_le(*val);
30665 }
30666 let len = __tmp.len();
30667 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30668 } else {
30669 __tmp.len()
30670 }
30671 }
30672}
30673#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
30674#[doc = ""]
30675#[doc = "ID: 269"]
30676#[derive(Debug, Clone, PartialEq)]
30677#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30678#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30679pub struct VIDEO_STREAM_INFORMATION_DATA {
30680 #[doc = "Frame rate."]
30681 pub framerate: f32,
30682 #[doc = "Bit rate."]
30683 pub bitrate: u32,
30684 #[doc = "Bitmap of stream status flags."]
30685 pub flags: VideoStreamStatusFlags,
30686 #[doc = "Horizontal resolution."]
30687 pub resolution_h: u16,
30688 #[doc = "Vertical resolution."]
30689 pub resolution_v: u16,
30690 #[doc = "Video image rotation clockwise."]
30691 pub rotation: u16,
30692 #[doc = "Horizontal Field of view."]
30693 pub hfov: u16,
30694 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
30695 pub stream_id: u8,
30696 #[doc = "Number of streams available."]
30697 pub count: u8,
30698 #[doc = "Type of stream."]
30699 pub mavtype: VideoStreamType,
30700 #[doc = "Stream name."]
30701 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30702 pub name: [u8; 32],
30703 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
30704 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30705 pub uri: [u8; 160],
30706 #[doc = "Encoding of stream."]
30707 #[cfg_attr(feature = "serde", serde(default))]
30708 pub encoding: VideoStreamEncoding,
30709 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
30710 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30711 pub camera_device_id: u8,
30712}
30713impl VIDEO_STREAM_INFORMATION_DATA {
30714 pub const ENCODED_LEN: usize = 215usize;
30715 pub const DEFAULT: Self = Self {
30716 framerate: 0.0_f32,
30717 bitrate: 0_u32,
30718 flags: VideoStreamStatusFlags::DEFAULT,
30719 resolution_h: 0_u16,
30720 resolution_v: 0_u16,
30721 rotation: 0_u16,
30722 hfov: 0_u16,
30723 stream_id: 0_u8,
30724 count: 0_u8,
30725 mavtype: VideoStreamType::DEFAULT,
30726 name: [0_u8; 32usize],
30727 uri: [0_u8; 160usize],
30728 encoding: VideoStreamEncoding::DEFAULT,
30729 camera_device_id: 0_u8,
30730 };
30731 #[cfg(feature = "arbitrary")]
30732 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30733 use arbitrary::{Arbitrary, Unstructured};
30734 let mut buf = [0u8; 1024];
30735 rng.fill_bytes(&mut buf);
30736 let mut unstructured = Unstructured::new(&buf);
30737 Self::arbitrary(&mut unstructured).unwrap_or_default()
30738 }
30739}
30740impl Default for VIDEO_STREAM_INFORMATION_DATA {
30741 fn default() -> Self {
30742 Self::DEFAULT.clone()
30743 }
30744}
30745impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
30746 type Message = MavMessage;
30747 const ID: u32 = 269u32;
30748 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
30749 const EXTRA_CRC: u8 = 109u8;
30750 const ENCODED_LEN: usize = 215usize;
30751 fn deser(
30752 _version: MavlinkVersion,
30753 __input: &[u8],
30754 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30755 let avail_len = __input.len();
30756 let mut payload_buf = [0; Self::ENCODED_LEN];
30757 let mut buf = if avail_len < Self::ENCODED_LEN {
30758 payload_buf[0..avail_len].copy_from_slice(__input);
30759 Bytes::new(&payload_buf)
30760 } else {
30761 Bytes::new(__input)
30762 };
30763 let mut __struct = Self::default();
30764 __struct.framerate = buf.get_f32_le();
30765 __struct.bitrate = buf.get_u32_le();
30766 let tmp = buf.get_u16_le();
30767 __struct.flags = VideoStreamStatusFlags::from_bits(
30768 tmp & VideoStreamStatusFlags::all().bits(),
30769 )
30770 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30771 flag_type: "VideoStreamStatusFlags",
30772 value: tmp as u32,
30773 })?;
30774 __struct.resolution_h = buf.get_u16_le();
30775 __struct.resolution_v = buf.get_u16_le();
30776 __struct.rotation = buf.get_u16_le();
30777 __struct.hfov = buf.get_u16_le();
30778 __struct.stream_id = buf.get_u8();
30779 __struct.count = buf.get_u8();
30780 let tmp = buf.get_u8();
30781 __struct.mavtype =
30782 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30783 enum_type: "VideoStreamType",
30784 value: tmp as u32,
30785 })?;
30786 for v in &mut __struct.name {
30787 let val = buf.get_u8();
30788 *v = val;
30789 }
30790 for v in &mut __struct.uri {
30791 let val = buf.get_u8();
30792 *v = val;
30793 }
30794 let tmp = buf.get_u8();
30795 __struct.encoding =
30796 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30797 enum_type: "VideoStreamEncoding",
30798 value: tmp as u32,
30799 })?;
30800 __struct.camera_device_id = buf.get_u8();
30801 Ok(__struct)
30802 }
30803 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30804 let mut __tmp = BytesMut::new(bytes);
30805 #[allow(clippy::absurd_extreme_comparisons)]
30806 #[allow(unused_comparisons)]
30807 if __tmp.remaining() < Self::ENCODED_LEN {
30808 panic!(
30809 "buffer is too small (need {} bytes, but got {})",
30810 Self::ENCODED_LEN,
30811 __tmp.remaining(),
30812 )
30813 }
30814 __tmp.put_f32_le(self.framerate);
30815 __tmp.put_u32_le(self.bitrate);
30816 __tmp.put_u16_le(self.flags.bits());
30817 __tmp.put_u16_le(self.resolution_h);
30818 __tmp.put_u16_le(self.resolution_v);
30819 __tmp.put_u16_le(self.rotation);
30820 __tmp.put_u16_le(self.hfov);
30821 __tmp.put_u8(self.stream_id);
30822 __tmp.put_u8(self.count);
30823 __tmp.put_u8(self.mavtype as u8);
30824 for val in &self.name {
30825 __tmp.put_u8(*val);
30826 }
30827 for val in &self.uri {
30828 __tmp.put_u8(*val);
30829 }
30830 if matches!(version, MavlinkVersion::V2) {
30831 __tmp.put_u8(self.encoding as u8);
30832 __tmp.put_u8(self.camera_device_id);
30833 let len = __tmp.len();
30834 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30835 } else {
30836 __tmp.len()
30837 }
30838 }
30839}
30840#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
30841#[doc = ""]
30842#[doc = "ID: 270"]
30843#[derive(Debug, Clone, PartialEq)]
30844#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30845#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30846pub struct VIDEO_STREAM_STATUS_DATA {
30847 #[doc = "Frame rate"]
30848 pub framerate: f32,
30849 #[doc = "Bit rate"]
30850 pub bitrate: u32,
30851 #[doc = "Bitmap of stream status flags"]
30852 pub flags: VideoStreamStatusFlags,
30853 #[doc = "Horizontal resolution"]
30854 pub resolution_h: u16,
30855 #[doc = "Vertical resolution"]
30856 pub resolution_v: u16,
30857 #[doc = "Video image rotation clockwise"]
30858 pub rotation: u16,
30859 #[doc = "Horizontal Field of view"]
30860 pub hfov: u16,
30861 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
30862 pub stream_id: u8,
30863 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
30864 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30865 pub camera_device_id: u8,
30866}
30867impl VIDEO_STREAM_STATUS_DATA {
30868 pub const ENCODED_LEN: usize = 20usize;
30869 pub const DEFAULT: Self = Self {
30870 framerate: 0.0_f32,
30871 bitrate: 0_u32,
30872 flags: VideoStreamStatusFlags::DEFAULT,
30873 resolution_h: 0_u16,
30874 resolution_v: 0_u16,
30875 rotation: 0_u16,
30876 hfov: 0_u16,
30877 stream_id: 0_u8,
30878 camera_device_id: 0_u8,
30879 };
30880 #[cfg(feature = "arbitrary")]
30881 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30882 use arbitrary::{Arbitrary, Unstructured};
30883 let mut buf = [0u8; 1024];
30884 rng.fill_bytes(&mut buf);
30885 let mut unstructured = Unstructured::new(&buf);
30886 Self::arbitrary(&mut unstructured).unwrap_or_default()
30887 }
30888}
30889impl Default for VIDEO_STREAM_STATUS_DATA {
30890 fn default() -> Self {
30891 Self::DEFAULT.clone()
30892 }
30893}
30894impl MessageData for VIDEO_STREAM_STATUS_DATA {
30895 type Message = MavMessage;
30896 const ID: u32 = 270u32;
30897 const NAME: &'static str = "VIDEO_STREAM_STATUS";
30898 const EXTRA_CRC: u8 = 59u8;
30899 const ENCODED_LEN: usize = 20usize;
30900 fn deser(
30901 _version: MavlinkVersion,
30902 __input: &[u8],
30903 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30904 let avail_len = __input.len();
30905 let mut payload_buf = [0; Self::ENCODED_LEN];
30906 let mut buf = if avail_len < Self::ENCODED_LEN {
30907 payload_buf[0..avail_len].copy_from_slice(__input);
30908 Bytes::new(&payload_buf)
30909 } else {
30910 Bytes::new(__input)
30911 };
30912 let mut __struct = Self::default();
30913 __struct.framerate = buf.get_f32_le();
30914 __struct.bitrate = buf.get_u32_le();
30915 let tmp = buf.get_u16_le();
30916 __struct.flags = VideoStreamStatusFlags::from_bits(
30917 tmp & VideoStreamStatusFlags::all().bits(),
30918 )
30919 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30920 flag_type: "VideoStreamStatusFlags",
30921 value: tmp as u32,
30922 })?;
30923 __struct.resolution_h = buf.get_u16_le();
30924 __struct.resolution_v = buf.get_u16_le();
30925 __struct.rotation = buf.get_u16_le();
30926 __struct.hfov = buf.get_u16_le();
30927 __struct.stream_id = buf.get_u8();
30928 __struct.camera_device_id = buf.get_u8();
30929 Ok(__struct)
30930 }
30931 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30932 let mut __tmp = BytesMut::new(bytes);
30933 #[allow(clippy::absurd_extreme_comparisons)]
30934 #[allow(unused_comparisons)]
30935 if __tmp.remaining() < Self::ENCODED_LEN {
30936 panic!(
30937 "buffer is too small (need {} bytes, but got {})",
30938 Self::ENCODED_LEN,
30939 __tmp.remaining(),
30940 )
30941 }
30942 __tmp.put_f32_le(self.framerate);
30943 __tmp.put_u32_le(self.bitrate);
30944 __tmp.put_u16_le(self.flags.bits());
30945 __tmp.put_u16_le(self.resolution_h);
30946 __tmp.put_u16_le(self.resolution_v);
30947 __tmp.put_u16_le(self.rotation);
30948 __tmp.put_u16_le(self.hfov);
30949 __tmp.put_u8(self.stream_id);
30950 if matches!(version, MavlinkVersion::V2) {
30951 __tmp.put_u8(self.camera_device_id);
30952 let len = __tmp.len();
30953 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30954 } else {
30955 __tmp.len()
30956 }
30957 }
30958}
30959#[doc = "Local position/attitude estimate from a vision source."]
30960#[doc = ""]
30961#[doc = "ID: 102"]
30962#[derive(Debug, Clone, PartialEq)]
30963#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30964#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30965pub struct VISION_POSITION_ESTIMATE_DATA {
30966 #[doc = "Timestamp (UNIX time or time since system boot)"]
30967 pub usec: u64,
30968 #[doc = "Local X position"]
30969 pub x: f32,
30970 #[doc = "Local Y position"]
30971 pub y: f32,
30972 #[doc = "Local Z position"]
30973 pub z: f32,
30974 #[doc = "Roll angle"]
30975 pub roll: f32,
30976 #[doc = "Pitch angle"]
30977 pub pitch: f32,
30978 #[doc = "Yaw angle"]
30979 pub yaw: f32,
30980 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
30981 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30982 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30983 pub covariance: [f32; 21],
30984 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
30985 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30986 pub reset_counter: u8,
30987}
30988impl VISION_POSITION_ESTIMATE_DATA {
30989 pub const ENCODED_LEN: usize = 117usize;
30990 pub const DEFAULT: Self = Self {
30991 usec: 0_u64,
30992 x: 0.0_f32,
30993 y: 0.0_f32,
30994 z: 0.0_f32,
30995 roll: 0.0_f32,
30996 pitch: 0.0_f32,
30997 yaw: 0.0_f32,
30998 covariance: [0.0_f32; 21usize],
30999 reset_counter: 0_u8,
31000 };
31001 #[cfg(feature = "arbitrary")]
31002 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31003 use arbitrary::{Arbitrary, Unstructured};
31004 let mut buf = [0u8; 1024];
31005 rng.fill_bytes(&mut buf);
31006 let mut unstructured = Unstructured::new(&buf);
31007 Self::arbitrary(&mut unstructured).unwrap_or_default()
31008 }
31009}
31010impl Default for VISION_POSITION_ESTIMATE_DATA {
31011 fn default() -> Self {
31012 Self::DEFAULT.clone()
31013 }
31014}
31015impl MessageData for VISION_POSITION_ESTIMATE_DATA {
31016 type Message = MavMessage;
31017 const ID: u32 = 102u32;
31018 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
31019 const EXTRA_CRC: u8 = 158u8;
31020 const ENCODED_LEN: usize = 117usize;
31021 fn deser(
31022 _version: MavlinkVersion,
31023 __input: &[u8],
31024 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31025 let avail_len = __input.len();
31026 let mut payload_buf = [0; Self::ENCODED_LEN];
31027 let mut buf = if avail_len < Self::ENCODED_LEN {
31028 payload_buf[0..avail_len].copy_from_slice(__input);
31029 Bytes::new(&payload_buf)
31030 } else {
31031 Bytes::new(__input)
31032 };
31033 let mut __struct = Self::default();
31034 __struct.usec = buf.get_u64_le();
31035 __struct.x = buf.get_f32_le();
31036 __struct.y = buf.get_f32_le();
31037 __struct.z = buf.get_f32_le();
31038 __struct.roll = buf.get_f32_le();
31039 __struct.pitch = buf.get_f32_le();
31040 __struct.yaw = buf.get_f32_le();
31041 for v in &mut __struct.covariance {
31042 let val = buf.get_f32_le();
31043 *v = val;
31044 }
31045 __struct.reset_counter = buf.get_u8();
31046 Ok(__struct)
31047 }
31048 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31049 let mut __tmp = BytesMut::new(bytes);
31050 #[allow(clippy::absurd_extreme_comparisons)]
31051 #[allow(unused_comparisons)]
31052 if __tmp.remaining() < Self::ENCODED_LEN {
31053 panic!(
31054 "buffer is too small (need {} bytes, but got {})",
31055 Self::ENCODED_LEN,
31056 __tmp.remaining(),
31057 )
31058 }
31059 __tmp.put_u64_le(self.usec);
31060 __tmp.put_f32_le(self.x);
31061 __tmp.put_f32_le(self.y);
31062 __tmp.put_f32_le(self.z);
31063 __tmp.put_f32_le(self.roll);
31064 __tmp.put_f32_le(self.pitch);
31065 __tmp.put_f32_le(self.yaw);
31066 if matches!(version, MavlinkVersion::V2) {
31067 for val in &self.covariance {
31068 __tmp.put_f32_le(*val);
31069 }
31070 __tmp.put_u8(self.reset_counter);
31071 let len = __tmp.len();
31072 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31073 } else {
31074 __tmp.len()
31075 }
31076 }
31077}
31078#[doc = "Speed estimate from a vision source."]
31079#[doc = ""]
31080#[doc = "ID: 103"]
31081#[derive(Debug, Clone, PartialEq)]
31082#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31083#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31084pub struct VISION_SPEED_ESTIMATE_DATA {
31085 #[doc = "Timestamp (UNIX time or time since system boot)"]
31086 pub usec: u64,
31087 #[doc = "Global X speed"]
31088 pub x: f32,
31089 #[doc = "Global Y speed"]
31090 pub y: f32,
31091 #[doc = "Global Z speed"]
31092 pub z: f32,
31093 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
31094 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31095 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31096 pub covariance: [f32; 9],
31097 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31098 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31099 pub reset_counter: u8,
31100}
31101impl VISION_SPEED_ESTIMATE_DATA {
31102 pub const ENCODED_LEN: usize = 57usize;
31103 pub const DEFAULT: Self = Self {
31104 usec: 0_u64,
31105 x: 0.0_f32,
31106 y: 0.0_f32,
31107 z: 0.0_f32,
31108 covariance: [0.0_f32; 9usize],
31109 reset_counter: 0_u8,
31110 };
31111 #[cfg(feature = "arbitrary")]
31112 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31113 use arbitrary::{Arbitrary, Unstructured};
31114 let mut buf = [0u8; 1024];
31115 rng.fill_bytes(&mut buf);
31116 let mut unstructured = Unstructured::new(&buf);
31117 Self::arbitrary(&mut unstructured).unwrap_or_default()
31118 }
31119}
31120impl Default for VISION_SPEED_ESTIMATE_DATA {
31121 fn default() -> Self {
31122 Self::DEFAULT.clone()
31123 }
31124}
31125impl MessageData for VISION_SPEED_ESTIMATE_DATA {
31126 type Message = MavMessage;
31127 const ID: u32 = 103u32;
31128 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
31129 const EXTRA_CRC: u8 = 208u8;
31130 const ENCODED_LEN: usize = 57usize;
31131 fn deser(
31132 _version: MavlinkVersion,
31133 __input: &[u8],
31134 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31135 let avail_len = __input.len();
31136 let mut payload_buf = [0; Self::ENCODED_LEN];
31137 let mut buf = if avail_len < Self::ENCODED_LEN {
31138 payload_buf[0..avail_len].copy_from_slice(__input);
31139 Bytes::new(&payload_buf)
31140 } else {
31141 Bytes::new(__input)
31142 };
31143 let mut __struct = Self::default();
31144 __struct.usec = buf.get_u64_le();
31145 __struct.x = buf.get_f32_le();
31146 __struct.y = buf.get_f32_le();
31147 __struct.z = buf.get_f32_le();
31148 for v in &mut __struct.covariance {
31149 let val = buf.get_f32_le();
31150 *v = val;
31151 }
31152 __struct.reset_counter = buf.get_u8();
31153 Ok(__struct)
31154 }
31155 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31156 let mut __tmp = BytesMut::new(bytes);
31157 #[allow(clippy::absurd_extreme_comparisons)]
31158 #[allow(unused_comparisons)]
31159 if __tmp.remaining() < Self::ENCODED_LEN {
31160 panic!(
31161 "buffer is too small (need {} bytes, but got {})",
31162 Self::ENCODED_LEN,
31163 __tmp.remaining(),
31164 )
31165 }
31166 __tmp.put_u64_le(self.usec);
31167 __tmp.put_f32_le(self.x);
31168 __tmp.put_f32_le(self.y);
31169 __tmp.put_f32_le(self.z);
31170 if matches!(version, MavlinkVersion::V2) {
31171 for val in &self.covariance {
31172 __tmp.put_f32_le(*val);
31173 }
31174 __tmp.put_u8(self.reset_counter);
31175 let len = __tmp.len();
31176 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31177 } else {
31178 __tmp.len()
31179 }
31180 }
31181}
31182#[doc = "Cumulative distance traveled for each reported wheel."]
31183#[doc = ""]
31184#[doc = "ID: 9000"]
31185#[derive(Debug, Clone, PartialEq)]
31186#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31187#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31188pub struct WHEEL_DISTANCE_DATA {
31189 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
31190 pub time_usec: u64,
31191 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
31192 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31193 pub distance: [f64; 16],
31194 #[doc = "Number of wheels reported."]
31195 pub count: u8,
31196}
31197impl WHEEL_DISTANCE_DATA {
31198 pub const ENCODED_LEN: usize = 137usize;
31199 pub const DEFAULT: Self = Self {
31200 time_usec: 0_u64,
31201 distance: [0.0_f64; 16usize],
31202 count: 0_u8,
31203 };
31204 #[cfg(feature = "arbitrary")]
31205 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31206 use arbitrary::{Arbitrary, Unstructured};
31207 let mut buf = [0u8; 1024];
31208 rng.fill_bytes(&mut buf);
31209 let mut unstructured = Unstructured::new(&buf);
31210 Self::arbitrary(&mut unstructured).unwrap_or_default()
31211 }
31212}
31213impl Default for WHEEL_DISTANCE_DATA {
31214 fn default() -> Self {
31215 Self::DEFAULT.clone()
31216 }
31217}
31218impl MessageData for WHEEL_DISTANCE_DATA {
31219 type Message = MavMessage;
31220 const ID: u32 = 9000u32;
31221 const NAME: &'static str = "WHEEL_DISTANCE";
31222 const EXTRA_CRC: u8 = 113u8;
31223 const ENCODED_LEN: usize = 137usize;
31224 fn deser(
31225 _version: MavlinkVersion,
31226 __input: &[u8],
31227 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31228 let avail_len = __input.len();
31229 let mut payload_buf = [0; Self::ENCODED_LEN];
31230 let mut buf = if avail_len < Self::ENCODED_LEN {
31231 payload_buf[0..avail_len].copy_from_slice(__input);
31232 Bytes::new(&payload_buf)
31233 } else {
31234 Bytes::new(__input)
31235 };
31236 let mut __struct = Self::default();
31237 __struct.time_usec = buf.get_u64_le();
31238 for v in &mut __struct.distance {
31239 let val = buf.get_f64_le();
31240 *v = val;
31241 }
31242 __struct.count = buf.get_u8();
31243 Ok(__struct)
31244 }
31245 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31246 let mut __tmp = BytesMut::new(bytes);
31247 #[allow(clippy::absurd_extreme_comparisons)]
31248 #[allow(unused_comparisons)]
31249 if __tmp.remaining() < Self::ENCODED_LEN {
31250 panic!(
31251 "buffer is too small (need {} bytes, but got {})",
31252 Self::ENCODED_LEN,
31253 __tmp.remaining(),
31254 )
31255 }
31256 __tmp.put_u64_le(self.time_usec);
31257 for val in &self.distance {
31258 __tmp.put_f64_le(*val);
31259 }
31260 __tmp.put_u8(self.count);
31261 if matches!(version, MavlinkVersion::V2) {
31262 let len = __tmp.len();
31263 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31264 } else {
31265 __tmp.len()
31266 }
31267 }
31268}
31269#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
31270#[doc = ""]
31271#[doc = "ID: 299"]
31272#[derive(Debug, Clone, PartialEq)]
31273#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31274#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31275pub struct WIFI_CONFIG_AP_DATA {
31276 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
31277 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31278 pub ssid: [u8; 32],
31279 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
31280 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31281 pub password: [u8; 64],
31282 #[doc = "WiFi Mode."]
31283 #[cfg_attr(feature = "serde", serde(default))]
31284 pub mode: WifiConfigApMode,
31285 #[doc = "Message acceptance response (sent back to GS)."]
31286 #[cfg_attr(feature = "serde", serde(default))]
31287 pub response: WifiConfigApResponse,
31288}
31289impl WIFI_CONFIG_AP_DATA {
31290 pub const ENCODED_LEN: usize = 98usize;
31291 pub const DEFAULT: Self = Self {
31292 ssid: [0_u8; 32usize],
31293 password: [0_u8; 64usize],
31294 mode: WifiConfigApMode::DEFAULT,
31295 response: WifiConfigApResponse::DEFAULT,
31296 };
31297 #[cfg(feature = "arbitrary")]
31298 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31299 use arbitrary::{Arbitrary, Unstructured};
31300 let mut buf = [0u8; 1024];
31301 rng.fill_bytes(&mut buf);
31302 let mut unstructured = Unstructured::new(&buf);
31303 Self::arbitrary(&mut unstructured).unwrap_or_default()
31304 }
31305}
31306impl Default for WIFI_CONFIG_AP_DATA {
31307 fn default() -> Self {
31308 Self::DEFAULT.clone()
31309 }
31310}
31311impl MessageData for WIFI_CONFIG_AP_DATA {
31312 type Message = MavMessage;
31313 const ID: u32 = 299u32;
31314 const NAME: &'static str = "WIFI_CONFIG_AP";
31315 const EXTRA_CRC: u8 = 19u8;
31316 const ENCODED_LEN: usize = 98usize;
31317 fn deser(
31318 _version: MavlinkVersion,
31319 __input: &[u8],
31320 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31321 let avail_len = __input.len();
31322 let mut payload_buf = [0; Self::ENCODED_LEN];
31323 let mut buf = if avail_len < Self::ENCODED_LEN {
31324 payload_buf[0..avail_len].copy_from_slice(__input);
31325 Bytes::new(&payload_buf)
31326 } else {
31327 Bytes::new(__input)
31328 };
31329 let mut __struct = Self::default();
31330 for v in &mut __struct.ssid {
31331 let val = buf.get_u8();
31332 *v = val;
31333 }
31334 for v in &mut __struct.password {
31335 let val = buf.get_u8();
31336 *v = val;
31337 }
31338 let tmp = buf.get_i8();
31339 __struct.mode =
31340 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31341 enum_type: "WifiConfigApMode",
31342 value: tmp as u32,
31343 })?;
31344 let tmp = buf.get_i8();
31345 __struct.response =
31346 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31347 enum_type: "WifiConfigApResponse",
31348 value: tmp as u32,
31349 })?;
31350 Ok(__struct)
31351 }
31352 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31353 let mut __tmp = BytesMut::new(bytes);
31354 #[allow(clippy::absurd_extreme_comparisons)]
31355 #[allow(unused_comparisons)]
31356 if __tmp.remaining() < Self::ENCODED_LEN {
31357 panic!(
31358 "buffer is too small (need {} bytes, but got {})",
31359 Self::ENCODED_LEN,
31360 __tmp.remaining(),
31361 )
31362 }
31363 for val in &self.ssid {
31364 __tmp.put_u8(*val);
31365 }
31366 for val in &self.password {
31367 __tmp.put_u8(*val);
31368 }
31369 if matches!(version, MavlinkVersion::V2) {
31370 __tmp.put_i8(self.mode as i8);
31371 __tmp.put_i8(self.response as i8);
31372 let len = __tmp.len();
31373 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31374 } else {
31375 __tmp.len()
31376 }
31377 }
31378}
31379#[doc = "Winch status."]
31380#[doc = ""]
31381#[doc = "ID: 9005"]
31382#[derive(Debug, Clone, PartialEq)]
31383#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31384#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31385pub struct WINCH_STATUS_DATA {
31386 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
31387 pub time_usec: u64,
31388 #[doc = "Length of line released. NaN if unknown"]
31389 pub line_length: f32,
31390 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
31391 pub speed: f32,
31392 #[doc = "Tension on the line. NaN if unknown"]
31393 pub tension: f32,
31394 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
31395 pub voltage: f32,
31396 #[doc = "Current draw from the winch. NaN if unknown"]
31397 pub current: f32,
31398 #[doc = "Status flags"]
31399 pub status: MavWinchStatusFlag,
31400 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
31401 pub temperature: i16,
31402}
31403impl WINCH_STATUS_DATA {
31404 pub const ENCODED_LEN: usize = 34usize;
31405 pub const DEFAULT: Self = Self {
31406 time_usec: 0_u64,
31407 line_length: 0.0_f32,
31408 speed: 0.0_f32,
31409 tension: 0.0_f32,
31410 voltage: 0.0_f32,
31411 current: 0.0_f32,
31412 status: MavWinchStatusFlag::DEFAULT,
31413 temperature: 0_i16,
31414 };
31415 #[cfg(feature = "arbitrary")]
31416 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31417 use arbitrary::{Arbitrary, Unstructured};
31418 let mut buf = [0u8; 1024];
31419 rng.fill_bytes(&mut buf);
31420 let mut unstructured = Unstructured::new(&buf);
31421 Self::arbitrary(&mut unstructured).unwrap_or_default()
31422 }
31423}
31424impl Default for WINCH_STATUS_DATA {
31425 fn default() -> Self {
31426 Self::DEFAULT.clone()
31427 }
31428}
31429impl MessageData for WINCH_STATUS_DATA {
31430 type Message = MavMessage;
31431 const ID: u32 = 9005u32;
31432 const NAME: &'static str = "WINCH_STATUS";
31433 const EXTRA_CRC: u8 = 117u8;
31434 const ENCODED_LEN: usize = 34usize;
31435 fn deser(
31436 _version: MavlinkVersion,
31437 __input: &[u8],
31438 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31439 let avail_len = __input.len();
31440 let mut payload_buf = [0; Self::ENCODED_LEN];
31441 let mut buf = if avail_len < Self::ENCODED_LEN {
31442 payload_buf[0..avail_len].copy_from_slice(__input);
31443 Bytes::new(&payload_buf)
31444 } else {
31445 Bytes::new(__input)
31446 };
31447 let mut __struct = Self::default();
31448 __struct.time_usec = buf.get_u64_le();
31449 __struct.line_length = buf.get_f32_le();
31450 __struct.speed = buf.get_f32_le();
31451 __struct.tension = buf.get_f32_le();
31452 __struct.voltage = buf.get_f32_le();
31453 __struct.current = buf.get_f32_le();
31454 let tmp = buf.get_u32_le();
31455 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
31456 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31457 flag_type: "MavWinchStatusFlag",
31458 value: tmp as u32,
31459 })?;
31460 __struct.temperature = buf.get_i16_le();
31461 Ok(__struct)
31462 }
31463 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31464 let mut __tmp = BytesMut::new(bytes);
31465 #[allow(clippy::absurd_extreme_comparisons)]
31466 #[allow(unused_comparisons)]
31467 if __tmp.remaining() < Self::ENCODED_LEN {
31468 panic!(
31469 "buffer is too small (need {} bytes, but got {})",
31470 Self::ENCODED_LEN,
31471 __tmp.remaining(),
31472 )
31473 }
31474 __tmp.put_u64_le(self.time_usec);
31475 __tmp.put_f32_le(self.line_length);
31476 __tmp.put_f32_le(self.speed);
31477 __tmp.put_f32_le(self.tension);
31478 __tmp.put_f32_le(self.voltage);
31479 __tmp.put_f32_le(self.current);
31480 __tmp.put_u32_le(self.status.bits());
31481 __tmp.put_i16_le(self.temperature);
31482 if matches!(version, MavlinkVersion::V2) {
31483 let len = __tmp.len();
31484 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31485 } else {
31486 __tmp.len()
31487 }
31488 }
31489}
31490#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
31491#[doc = ""]
31492#[doc = "ID: 231"]
31493#[derive(Debug, Clone, PartialEq)]
31494#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31495#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31496pub struct WIND_COV_DATA {
31497 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31498 pub time_usec: u64,
31499 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
31500 pub wind_x: f32,
31501 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
31502 pub wind_y: f32,
31503 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
31504 pub wind_z: f32,
31505 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31506 pub var_horiz: f32,
31507 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31508 pub var_vert: f32,
31509 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
31510 pub wind_alt: f32,
31511 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
31512 pub horiz_accuracy: f32,
31513 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
31514 pub vert_accuracy: f32,
31515}
31516impl WIND_COV_DATA {
31517 pub const ENCODED_LEN: usize = 40usize;
31518 pub const DEFAULT: Self = Self {
31519 time_usec: 0_u64,
31520 wind_x: 0.0_f32,
31521 wind_y: 0.0_f32,
31522 wind_z: 0.0_f32,
31523 var_horiz: 0.0_f32,
31524 var_vert: 0.0_f32,
31525 wind_alt: 0.0_f32,
31526 horiz_accuracy: 0.0_f32,
31527 vert_accuracy: 0.0_f32,
31528 };
31529 #[cfg(feature = "arbitrary")]
31530 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31531 use arbitrary::{Arbitrary, Unstructured};
31532 let mut buf = [0u8; 1024];
31533 rng.fill_bytes(&mut buf);
31534 let mut unstructured = Unstructured::new(&buf);
31535 Self::arbitrary(&mut unstructured).unwrap_or_default()
31536 }
31537}
31538impl Default for WIND_COV_DATA {
31539 fn default() -> Self {
31540 Self::DEFAULT.clone()
31541 }
31542}
31543impl MessageData for WIND_COV_DATA {
31544 type Message = MavMessage;
31545 const ID: u32 = 231u32;
31546 const NAME: &'static str = "WIND_COV";
31547 const EXTRA_CRC: u8 = 105u8;
31548 const ENCODED_LEN: usize = 40usize;
31549 fn deser(
31550 _version: MavlinkVersion,
31551 __input: &[u8],
31552 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31553 let avail_len = __input.len();
31554 let mut payload_buf = [0; Self::ENCODED_LEN];
31555 let mut buf = if avail_len < Self::ENCODED_LEN {
31556 payload_buf[0..avail_len].copy_from_slice(__input);
31557 Bytes::new(&payload_buf)
31558 } else {
31559 Bytes::new(__input)
31560 };
31561 let mut __struct = Self::default();
31562 __struct.time_usec = buf.get_u64_le();
31563 __struct.wind_x = buf.get_f32_le();
31564 __struct.wind_y = buf.get_f32_le();
31565 __struct.wind_z = buf.get_f32_le();
31566 __struct.var_horiz = buf.get_f32_le();
31567 __struct.var_vert = buf.get_f32_le();
31568 __struct.wind_alt = buf.get_f32_le();
31569 __struct.horiz_accuracy = buf.get_f32_le();
31570 __struct.vert_accuracy = buf.get_f32_le();
31571 Ok(__struct)
31572 }
31573 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31574 let mut __tmp = BytesMut::new(bytes);
31575 #[allow(clippy::absurd_extreme_comparisons)]
31576 #[allow(unused_comparisons)]
31577 if __tmp.remaining() < Self::ENCODED_LEN {
31578 panic!(
31579 "buffer is too small (need {} bytes, but got {})",
31580 Self::ENCODED_LEN,
31581 __tmp.remaining(),
31582 )
31583 }
31584 __tmp.put_u64_le(self.time_usec);
31585 __tmp.put_f32_le(self.wind_x);
31586 __tmp.put_f32_le(self.wind_y);
31587 __tmp.put_f32_le(self.wind_z);
31588 __tmp.put_f32_le(self.var_horiz);
31589 __tmp.put_f32_le(self.var_vert);
31590 __tmp.put_f32_le(self.wind_alt);
31591 __tmp.put_f32_le(self.horiz_accuracy);
31592 __tmp.put_f32_le(self.vert_accuracy);
31593 if matches!(version, MavlinkVersion::V2) {
31594 let len = __tmp.len();
31595 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31596 } else {
31597 __tmp.len()
31598 }
31599 }
31600}
31601#[derive(Clone, PartialEq, Debug)]
31602#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31603#[cfg_attr(feature = "serde", serde(tag = "type"))]
31604#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31605#[repr(u32)]
31606pub enum MavMessage {
31607 #[doc = "Set the vehicle attitude and body angular rates."]
31608 #[doc = ""]
31609 #[doc = "ID: 140"]
31610 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
31611 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
31612 #[doc = ""]
31613 #[doc = "ID: 375"]
31614 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
31615 #[doc = "The location and information of an ADSB vehicle."]
31616 #[doc = ""]
31617 #[doc = "ID: 246"]
31618 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
31619 #[doc = "The location and information of an AIS vessel."]
31620 #[doc = ""]
31621 #[doc = "ID: 301"]
31622 AIS_VESSEL(AIS_VESSEL_DATA),
31623 #[doc = "The current system altitude."]
31624 #[doc = ""]
31625 #[doc = "ID: 141"]
31626 ALTITUDE(ALTITUDE_DATA),
31627 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
31628 #[doc = ""]
31629 #[doc = "ID: 30"]
31630 ATTITUDE(ATTITUDE_DATA),
31631 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
31632 #[doc = ""]
31633 #[doc = "ID: 31"]
31634 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
31635 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
31636 #[doc = ""]
31637 #[doc = "ID: 61"]
31638 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
31639 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
31640 #[doc = ""]
31641 #[doc = "ID: 83"]
31642 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
31643 #[doc = "Motion capture attitude and position."]
31644 #[doc = ""]
31645 #[doc = "ID: 138"]
31646 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
31647 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
31648 #[doc = ""]
31649 #[doc = "ID: 7"]
31650 AUTH_KEY(AUTH_KEY_DATA),
31651 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
31652 #[doc = ""]
31653 #[doc = "ID: 286"]
31654 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
31655 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
31656 #[doc = ""]
31657 #[doc = "ID: 148"]
31658 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
31659 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
31660 #[doc = ""]
31661 #[doc = "ID: 435"]
31662 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
31663 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
31664 #[doc = ""]
31665 #[doc = "ID: 437"]
31666 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
31667 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
31668 #[doc = ""]
31669 #[doc = "ID: 372"]
31670 BATTERY_INFO(BATTERY_INFO_DATA),
31671 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
31672 #[doc = ""]
31673 #[doc = "ID: 147"]
31674 BATTERY_STATUS(BATTERY_STATUS_DATA),
31675 #[doc = "Report button state change."]
31676 #[doc = ""]
31677 #[doc = "ID: 257"]
31678 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
31679 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
31680 #[doc = ""]
31681 #[doc = "ID: 262"]
31682 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
31683 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
31684 #[doc = ""]
31685 #[doc = "ID: 271"]
31686 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
31687 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
31688 #[doc = ""]
31689 #[doc = "ID: 263"]
31690 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
31691 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
31692 #[doc = ""]
31693 #[doc = "ID: 259"]
31694 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
31695 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
31696 #[doc = ""]
31697 #[doc = "ID: 260"]
31698 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
31699 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
31700 #[doc = ""]
31701 #[doc = "ID: 277"]
31702 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
31703 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
31704 #[doc = ""]
31705 #[doc = "ID: 276"]
31706 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
31707 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
31708 #[doc = ""]
31709 #[doc = "ID: 275"]
31710 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
31711 #[doc = "Camera-IMU triggering and synchronisation message."]
31712 #[doc = ""]
31713 #[doc = "ID: 112"]
31714 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
31715 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
31716 #[doc = ""]
31717 #[doc = "ID: 387"]
31718 CANFD_FRAME(CANFD_FRAME_DATA),
31719 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
31720 #[doc = ""]
31721 #[doc = "ID: 388"]
31722 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
31723 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
31724 #[doc = ""]
31725 #[doc = "ID: 386"]
31726 CAN_FRAME(CAN_FRAME_DATA),
31727 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
31728 #[doc = ""]
31729 #[doc = "ID: 336"]
31730 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
31731 #[doc = "Report current used cellular network status."]
31732 #[doc = ""]
31733 #[doc = "ID: 334"]
31734 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
31735 #[doc = "Request to control this MAV."]
31736 #[doc = ""]
31737 #[doc = "ID: 5"]
31738 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
31739 #[doc = "Accept / deny control of this MAV."]
31740 #[doc = ""]
31741 #[doc = "ID: 6"]
31742 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
31743 #[doc = "Information about a potential collision."]
31744 #[doc = ""]
31745 #[doc = "ID: 247"]
31746 COLLISION(COLLISION_DATA),
31747 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
31748 #[doc = ""]
31749 #[doc = "ID: 77"]
31750 COMMAND_ACK(COMMAND_ACK_DATA),
31751 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
31752 #[doc = ""]
31753 #[doc = "ID: 80"]
31754 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
31755 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
31756 #[doc = ""]
31757 #[doc = "ID: 75"]
31758 COMMAND_INT(COMMAND_INT_DATA),
31759 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
31760 #[doc = ""]
31761 #[doc = "ID: 76"]
31762 COMMAND_LONG(COMMAND_LONG_DATA),
31763 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
31764 #[doc = ""]
31765 #[doc = "ID: 395"]
31766 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
31767 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
31768 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
31769 #[doc = ""]
31770 #[doc = "ID: 396"]
31771 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
31772 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
31773 #[doc = ""]
31774 #[doc = "ID: 397"]
31775 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
31776 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
31777 #[doc = ""]
31778 #[doc = "ID: 146"]
31779 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
31780 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
31781 #[doc = ""]
31782 #[doc = "ID: 411"]
31783 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
31784 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
31785 #[doc = ""]
31786 #[doc = "ID: 436"]
31787 CURRENT_MODE(CURRENT_MODE_DATA),
31788 #[doc = "Data stream status information."]
31789 #[doc = ""]
31790 #[doc = "ID: 67"]
31791 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
31792 DATA_STREAM(DATA_STREAM_DATA),
31793 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
31794 #[doc = ""]
31795 #[doc = "ID: 130"]
31796 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
31797 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
31798 #[doc = ""]
31799 #[doc = "ID: 254"]
31800 DEBUG(DEBUG_DATA),
31801 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
31802 #[doc = ""]
31803 #[doc = "ID: 350"]
31804 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
31805 #[doc = "To debug something using a named 3D vector."]
31806 #[doc = ""]
31807 #[doc = "ID: 250"]
31808 DEBUG_VECT(DEBUG_VECT_DATA),
31809 #[doc = "Distance sensor information for an onboard rangefinder."]
31810 #[doc = ""]
31811 #[doc = "ID: 132"]
31812 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
31813 #[doc = "EFI status output."]
31814 #[doc = ""]
31815 #[doc = "ID: 225"]
31816 EFI_STATUS(EFI_STATUS_DATA),
31817 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
31818 #[doc = ""]
31819 #[doc = "ID: 131"]
31820 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
31821 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
31822 #[doc = ""]
31823 #[doc = "ID: 290"]
31824 ESC_INFO(ESC_INFO_DATA),
31825 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
31826 #[doc = ""]
31827 #[doc = "ID: 291"]
31828 ESC_STATUS(ESC_STATUS_DATA),
31829 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
31830 #[doc = ""]
31831 #[doc = "ID: 230"]
31832 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
31833 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
31834 #[doc = ""]
31835 #[doc = "ID: 410"]
31836 EVENT(EVENT_DATA),
31837 #[doc = "Provides state for additional features."]
31838 #[doc = ""]
31839 #[doc = "ID: 245"]
31840 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
31841 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
31842 #[doc = ""]
31843 #[doc = "ID: 162"]
31844 FENCE_STATUS(FENCE_STATUS_DATA),
31845 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
31846 #[doc = ""]
31847 #[doc = "ID: 110"]
31848 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
31849 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
31850 #[doc = ""]
31851 #[doc = "ID: 264"]
31852 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
31853 #[doc = "Current motion information from a designated system."]
31854 #[doc = ""]
31855 #[doc = "ID: 144"]
31856 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
31857 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
31858 #[doc = ""]
31859 #[doc = "ID: 371"]
31860 FUEL_STATUS(FUEL_STATUS_DATA),
31861 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
31862 #[doc = ""]
31863 #[doc = "ID: 373"]
31864 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
31865 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
31866 #[doc = ""]
31867 #[doc = "ID: 285"]
31868 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
31869 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
31870 #[doc = ""]
31871 #[doc = "ID: 283"]
31872 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
31873 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
31874 #[doc = ""]
31875 #[doc = "ID: 284"]
31876 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
31877 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
31878 #[doc = ""]
31879 #[doc = "ID: 280"]
31880 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
31881 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
31882 #[doc = ""]
31883 #[doc = "ID: 282"]
31884 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
31885 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
31886 #[doc = ""]
31887 #[doc = "ID: 288"]
31888 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
31889 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
31890 #[doc = ""]
31891 #[doc = "ID: 287"]
31892 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
31893 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
31894 #[doc = ""]
31895 #[doc = "ID: 281"]
31896 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
31897 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
31898 #[doc = ""]
31899 #[doc = "ID: 33"]
31900 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
31901 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
31902 #[doc = ""]
31903 #[doc = "ID: 63"]
31904 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
31905 #[doc = "Global position/attitude estimate from a vision source."]
31906 #[doc = ""]
31907 #[doc = "ID: 101"]
31908 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
31909 #[doc = "Second GPS data."]
31910 #[doc = ""]
31911 #[doc = "ID: 124"]
31912 GPS2_RAW(GPS2_RAW_DATA),
31913 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
31914 #[doc = ""]
31915 #[doc = "ID: 128"]
31916 GPS2_RTK(GPS2_RTK_DATA),
31917 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
31918 #[doc = ""]
31919 #[doc = "ID: 49"]
31920 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
31921 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
31922 #[doc = ""]
31923 #[doc = "ID: 123"]
31924 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
31925 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
31926 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
31927 #[doc = ""]
31928 #[doc = "ID: 232"]
31929 GPS_INPUT(GPS_INPUT_DATA),
31930 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
31931 #[doc = ""]
31932 #[doc = "ID: 24"]
31933 GPS_RAW_INT(GPS_RAW_INT_DATA),
31934 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
31935 #[doc = ""]
31936 #[doc = "ID: 233"]
31937 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
31938 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
31939 #[doc = ""]
31940 #[doc = "ID: 127"]
31941 GPS_RTK(GPS_RTK_DATA),
31942 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
31943 #[doc = ""]
31944 #[doc = "ID: 25"]
31945 GPS_STATUS(GPS_STATUS_DATA),
31946 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
31947 #[doc = ""]
31948 #[doc = "ID: 0"]
31949 HEARTBEAT(HEARTBEAT_DATA),
31950 #[doc = "The IMU readings in SI units in NED body frame."]
31951 #[doc = ""]
31952 #[doc = "ID: 105"]
31953 HIGHRES_IMU(HIGHRES_IMU_DATA),
31954 #[doc = "Message appropriate for high latency connections like Iridium."]
31955 #[doc = ""]
31956 #[doc = "ID: 234"]
31957 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
31958 HIGH_LATENCY(HIGH_LATENCY_DATA),
31959 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
31960 #[doc = ""]
31961 #[doc = "ID: 235"]
31962 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
31963 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
31964 #[doc = ""]
31965 #[doc = "ID: 93"]
31966 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
31967 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
31968 #[doc = ""]
31969 #[doc = "ID: 91"]
31970 HIL_CONTROLS(HIL_CONTROLS_DATA),
31971 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
31972 #[doc = ""]
31973 #[doc = "ID: 113"]
31974 HIL_GPS(HIL_GPS_DATA),
31975 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
31976 #[doc = ""]
31977 #[doc = "ID: 114"]
31978 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
31979 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
31980 #[doc = ""]
31981 #[doc = "ID: 92"]
31982 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
31983 #[doc = "The IMU readings in SI units in NED body frame."]
31984 #[doc = ""]
31985 #[doc = "ID: 107"]
31986 HIL_SENSOR(HIL_SENSOR_DATA),
31987 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
31988 #[doc = ""]
31989 #[doc = "ID: 90"]
31990 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
31991 HIL_STATE(HIL_STATE_DATA),
31992 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
31993 #[doc = ""]
31994 #[doc = "ID: 115"]
31995 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
31996 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
31997 #[doc = ""]
31998 #[doc = "ID: 242"]
31999 HOME_POSITION(HOME_POSITION_DATA),
32000 #[doc = "Temperature and humidity from hygrometer."]
32001 #[doc = ""]
32002 #[doc = "ID: 12920"]
32003 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
32004 #[doc = "Illuminator status."]
32005 #[doc = ""]
32006 #[doc = "ID: 440"]
32007 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
32008 #[doc = "Status of the Iridium SBD link."]
32009 #[doc = ""]
32010 #[doc = "ID: 335"]
32011 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
32012 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
32013 #[doc = ""]
32014 #[doc = "ID: 149"]
32015 LANDING_TARGET(LANDING_TARGET_DATA),
32016 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
32017 #[doc = ""]
32018 #[doc = "ID: 8"]
32019 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
32020 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32021 #[doc = ""]
32022 #[doc = "ID: 32"]
32023 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
32024 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32025 #[doc = ""]
32026 #[doc = "ID: 64"]
32027 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
32028 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32029 #[doc = ""]
32030 #[doc = "ID: 89"]
32031 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
32032 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
32033 #[doc = ""]
32034 #[doc = "ID: 268"]
32035 LOGGING_ACK(LOGGING_ACK_DATA),
32036 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
32037 #[doc = ""]
32038 #[doc = "ID: 266"]
32039 LOGGING_DATA(LOGGING_DATA_DATA),
32040 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
32041 #[doc = ""]
32042 #[doc = "ID: 267"]
32043 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
32044 #[doc = "Reply to LOG_REQUEST_DATA."]
32045 #[doc = ""]
32046 #[doc = "ID: 120"]
32047 LOG_DATA(LOG_DATA_DATA),
32048 #[doc = "Reply to LOG_REQUEST_LIST."]
32049 #[doc = ""]
32050 #[doc = "ID: 118"]
32051 LOG_ENTRY(LOG_ENTRY_DATA),
32052 #[doc = "Erase all logs."]
32053 #[doc = ""]
32054 #[doc = "ID: 121"]
32055 LOG_ERASE(LOG_ERASE_DATA),
32056 #[doc = "Request a chunk of a log."]
32057 #[doc = ""]
32058 #[doc = "ID: 119"]
32059 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
32060 #[doc = "Stop log transfer and resume normal logging."]
32061 #[doc = ""]
32062 #[doc = "ID: 122"]
32063 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
32064 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
32065 #[doc = ""]
32066 #[doc = "ID: 117"]
32067 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
32068 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
32069 #[doc = ""]
32070 #[doc = "ID: 192"]
32071 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
32072 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
32073 #[doc = ""]
32074 #[doc = "ID: 69"]
32075 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
32076 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
32077 #[doc = ""]
32078 #[doc = "ID: 81"]
32079 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
32080 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32081 #[doc = ""]
32082 #[doc = "ID: 249"]
32083 MEMORY_VECT(MEMORY_VECT_DATA),
32084 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
32085 #[doc = ""]
32086 #[doc = "ID: 244"]
32087 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
32088 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
32089 #[doc = ""]
32090 #[doc = "ID: 47"]
32091 MISSION_ACK(MISSION_ACK_DATA),
32092 #[doc = "Delete all mission items at once."]
32093 #[doc = ""]
32094 #[doc = "ID: 45"]
32095 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
32096 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
32097 #[doc = ""]
32098 #[doc = "ID: 44"]
32099 MISSION_COUNT(MISSION_COUNT_DATA),
32100 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
32101 #[doc = ""]
32102 #[doc = "ID: 42"]
32103 MISSION_CURRENT(MISSION_CURRENT_DATA),
32104 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
32105 #[doc = ""]
32106 #[doc = "ID: 39"]
32107 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
32108 MISSION_ITEM(MISSION_ITEM_DATA),
32109 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
32110 #[doc = ""]
32111 #[doc = "ID: 73"]
32112 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
32113 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
32114 #[doc = ""]
32115 #[doc = "ID: 46"]
32116 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
32117 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
32118 #[doc = ""]
32119 #[doc = "ID: 40"]
32120 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
32121 MISSION_REQUEST(MISSION_REQUEST_DATA),
32122 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
32123 #[doc = ""]
32124 #[doc = "ID: 51"]
32125 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
32126 #[doc = "Request the overall list of mission items from the system/component."]
32127 #[doc = ""]
32128 #[doc = "ID: 43"]
32129 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
32130 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
32131 #[doc = ""]
32132 #[doc = "ID: 37"]
32133 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
32134 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
32135 #[doc = ""]
32136 #[doc = "ID: 41"]
32137 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
32138 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
32139 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
32140 #[doc = ""]
32141 #[doc = "ID: 38"]
32142 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
32143 #[doc = "Orientation of a mount."]
32144 #[doc = ""]
32145 #[doc = "ID: 265"]
32146 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
32147 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
32148 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32149 #[doc = ""]
32150 #[doc = "ID: 251"]
32151 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
32152 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32153 #[doc = ""]
32154 #[doc = "ID: 252"]
32155 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
32156 #[doc = "The state of the navigation and position controller."]
32157 #[doc = ""]
32158 #[doc = "ID: 62"]
32159 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
32160 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
32161 #[doc = ""]
32162 #[doc = "ID: 330"]
32163 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
32164 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
32165 #[doc = ""]
32166 #[doc = "ID: 331"]
32167 ODOMETRY(ODOMETRY_DATA),
32168 #[doc = "Hardware status sent by an onboard computer."]
32169 #[doc = ""]
32170 #[doc = "ID: 390"]
32171 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
32172 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
32173 #[doc = ""]
32174 #[doc = "ID: 12918"]
32175 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
32176 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
32177 #[doc = ""]
32178 #[doc = "ID: 12902"]
32179 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
32180 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
32181 #[doc = ""]
32182 #[doc = "ID: 12900"]
32183 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
32184 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
32185 #[doc = ""]
32186 #[doc = "ID: 12901"]
32187 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
32188 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
32189 #[doc = ""]
32190 #[doc = "ID: 12915"]
32191 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
32192 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
32193 #[doc = ""]
32194 #[doc = "ID: 12905"]
32195 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
32196 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
32197 #[doc = ""]
32198 #[doc = "ID: 12903"]
32199 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
32200 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
32201 #[doc = ""]
32202 #[doc = "ID: 12904"]
32203 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
32204 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
32205 #[doc = ""]
32206 #[doc = "ID: 12919"]
32207 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
32208 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
32209 #[doc = ""]
32210 #[doc = "ID: 100"]
32211 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
32212 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
32213 #[doc = ""]
32214 #[doc = "ID: 106"]
32215 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
32216 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
32217 #[doc = ""]
32218 #[doc = "ID: 360"]
32219 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
32220 #[doc = "Response from a PARAM_EXT_SET message."]
32221 #[doc = ""]
32222 #[doc = "ID: 324"]
32223 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
32224 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
32225 #[doc = ""]
32226 #[doc = "ID: 321"]
32227 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
32228 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
32229 #[doc = ""]
32230 #[doc = "ID: 320"]
32231 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
32232 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
32233 #[doc = ""]
32234 #[doc = "ID: 323"]
32235 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
32236 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
32237 #[doc = ""]
32238 #[doc = "ID: 322"]
32239 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
32240 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
32241 #[doc = ""]
32242 #[doc = "ID: 50"]
32243 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
32244 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
32245 #[doc = ""]
32246 #[doc = "ID: 21"]
32247 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
32248 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
32249 #[doc = ""]
32250 #[doc = "ID: 20"]
32251 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
32252 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
32253 #[doc = ""]
32254 #[doc = "ID: 23"]
32255 PARAM_SET(PARAM_SET_DATA),
32256 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
32257 #[doc = ""]
32258 #[doc = "ID: 22"]
32259 PARAM_VALUE(PARAM_VALUE_DATA),
32260 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
32261 #[doc = ""]
32262 #[doc = "ID: 4"]
32263 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
32264 PING(PING_DATA),
32265 #[doc = "Control vehicle tone generation (buzzer)."]
32266 #[doc = ""]
32267 #[doc = "ID: 258"]
32268 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
32269 PLAY_TUNE(PLAY_TUNE_DATA),
32270 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
32271 #[doc = ""]
32272 #[doc = "ID: 400"]
32273 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
32274 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
32275 #[doc = ""]
32276 #[doc = "ID: 87"]
32277 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
32278 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
32279 #[doc = ""]
32280 #[doc = "ID: 85"]
32281 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
32282 #[doc = "Power supply status."]
32283 #[doc = ""]
32284 #[doc = "ID: 125"]
32285 POWER_STATUS(POWER_STATUS_DATA),
32286 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
32287 #[doc = ""]
32288 #[doc = "ID: 300"]
32289 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
32290 #[doc = "Status generated by radio and injected into MAVLink stream."]
32291 #[doc = ""]
32292 #[doc = "ID: 109"]
32293 RADIO_STATUS(RADIO_STATUS_DATA),
32294 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
32295 #[doc = ""]
32296 #[doc = "ID: 27"]
32297 RAW_IMU(RAW_IMU_DATA),
32298 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
32299 #[doc = ""]
32300 #[doc = "ID: 28"]
32301 RAW_PRESSURE(RAW_PRESSURE_DATA),
32302 #[doc = "RPM sensor data message."]
32303 #[doc = ""]
32304 #[doc = "ID: 339"]
32305 RAW_RPM(RAW_RPM_DATA),
32306 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
32307 #[doc = ""]
32308 #[doc = "ID: 65"]
32309 RC_CHANNELS(RC_CHANNELS_DATA),
32310 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
32311 #[doc = ""]
32312 #[doc = "ID: 70"]
32313 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
32314 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
32315 #[doc = ""]
32316 #[doc = "ID: 35"]
32317 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
32318 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
32319 #[doc = ""]
32320 #[doc = "ID: 34"]
32321 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
32322 #[doc = "Request a data stream."]
32323 #[doc = ""]
32324 #[doc = "ID: 66"]
32325 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
32326 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
32327 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
32328 #[doc = ""]
32329 #[doc = "ID: 412"]
32330 REQUEST_EVENT(REQUEST_EVENT_DATA),
32331 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
32332 #[doc = ""]
32333 #[doc = "ID: 142"]
32334 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
32335 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
32336 #[doc = ""]
32337 #[doc = "ID: 413"]
32338 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
32339 #[doc = "Read out the safety zone the MAV currently assumes."]
32340 #[doc = ""]
32341 #[doc = "ID: 55"]
32342 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
32343 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
32344 #[doc = ""]
32345 #[doc = "ID: 54"]
32346 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
32347 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
32348 #[doc = ""]
32349 #[doc = "ID: 26"]
32350 SCALED_IMU(SCALED_IMU_DATA),
32351 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
32352 #[doc = ""]
32353 #[doc = "ID: 116"]
32354 SCALED_IMU2(SCALED_IMU2_DATA),
32355 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
32356 #[doc = ""]
32357 #[doc = "ID: 129"]
32358 SCALED_IMU3(SCALED_IMU3_DATA),
32359 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
32360 #[doc = ""]
32361 #[doc = "ID: 29"]
32362 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
32363 #[doc = "Barometer readings for 2nd barometer."]
32364 #[doc = ""]
32365 #[doc = "ID: 137"]
32366 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
32367 #[doc = "Barometer readings for 3rd barometer."]
32368 #[doc = ""]
32369 #[doc = "ID: 143"]
32370 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
32371 #[doc = "This message is emitted as response to SCRIPT_REQUEST_LIST by the MAV to get the number of mission scripts."]
32372 #[doc = ""]
32373 #[doc = "ID: 183"]
32374 SCRIPT_COUNT(SCRIPT_COUNT_DATA),
32375 #[doc = "This message informs about the currently active SCRIPT."]
32376 #[doc = ""]
32377 #[doc = "ID: 184"]
32378 SCRIPT_CURRENT(SCRIPT_CURRENT_DATA),
32379 #[doc = "Message encoding a mission script item. This message is emitted upon a request for the next script item."]
32380 #[doc = ""]
32381 #[doc = "ID: 180"]
32382 SCRIPT_ITEM(SCRIPT_ITEM_DATA),
32383 #[doc = "Request script item with the sequence number seq. The response of the system to this message should be a SCRIPT_ITEM message."]
32384 #[doc = ""]
32385 #[doc = "ID: 181"]
32386 SCRIPT_REQUEST(SCRIPT_REQUEST_DATA),
32387 #[doc = "Request the overall list of mission items from the system/component."]
32388 #[doc = ""]
32389 #[doc = "ID: 182"]
32390 SCRIPT_REQUEST_LIST(SCRIPT_REQUEST_LIST_DATA),
32391 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
32392 #[doc = ""]
32393 #[doc = "ID: 126"]
32394 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
32395 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
32396 #[doc = ""]
32397 #[doc = "ID: 36"]
32398 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
32399 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
32400 #[doc = ""]
32401 #[doc = "ID: 256"]
32402 SETUP_SIGNING(SETUP_SIGNING_DATA),
32403 #[doc = "Set the vehicle attitude and body angular rates."]
32404 #[doc = ""]
32405 #[doc = "ID: 139"]
32406 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
32407 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
32408 #[doc = ""]
32409 #[doc = "ID: 82"]
32410 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
32411 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
32412 #[doc = ""]
32413 #[doc = "ID: 48"]
32414 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
32415 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
32416 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
32417 #[doc = ""]
32418 #[doc = "ID: 243"]
32419 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
32420 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
32421 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
32422 #[doc = ""]
32423 #[doc = "ID: 11"]
32424 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
32425 SET_MODE(SET_MODE_DATA),
32426 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
32427 #[doc = ""]
32428 #[doc = "ID: 86"]
32429 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
32430 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
32431 #[doc = ""]
32432 #[doc = "ID: 84"]
32433 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
32434 #[doc = "Status of simulation environment, if used."]
32435 #[doc = ""]
32436 #[doc = "ID: 108"]
32437 SIM_STATE(SIM_STATE_DATA),
32438 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
32439 #[doc = ""]
32440 #[doc = "ID: 370"]
32441 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
32442 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
32443 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
32444 #[doc = ""]
32445 #[doc = "ID: 253"]
32446 STATUSTEXT(STATUSTEXT_DATA),
32447 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
32448 #[doc = ""]
32449 #[doc = "ID: 261"]
32450 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
32451 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
32452 #[doc = ""]
32453 #[doc = "ID: 401"]
32454 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
32455 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
32456 #[doc = ""]
32457 #[doc = "ID: 2"]
32458 SYSTEM_TIME(SYSTEM_TIME_DATA),
32459 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
32460 #[doc = ""]
32461 #[doc = "ID: 1"]
32462 SYS_STATUS(SYS_STATUS_DATA),
32463 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
32464 #[doc = ""]
32465 #[doc = "ID: 135"]
32466 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
32467 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32468 #[doc = ""]
32469 #[doc = "ID: 134"]
32470 TERRAIN_DATA(TERRAIN_DATA_DATA),
32471 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32472 #[doc = ""]
32473 #[doc = "ID: 136"]
32474 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
32475 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32476 #[doc = ""]
32477 #[doc = "ID: 133"]
32478 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
32479 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
32480 #[doc = ""]
32481 #[doc = "ID: 111"]
32482 TIMESYNC(TIMESYNC_DATA),
32483 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
32484 #[doc = ""]
32485 #[doc = "ID: 380"]
32486 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
32487 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
32488 #[doc = ""]
32489 #[doc = "ID: 333"]
32490 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
32491 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
32492 #[doc = ""]
32493 #[doc = "ID: 332"]
32494 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
32495 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
32496 #[doc = ""]
32497 #[doc = "ID: 385"]
32498 TUNNEL(TUNNEL_DATA),
32499 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
32500 #[doc = ""]
32501 #[doc = "ID: 311"]
32502 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
32503 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
32504 #[doc = ""]
32505 #[doc = "ID: 310"]
32506 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
32507 #[doc = "The global position resulting from GPS and sensor fusion."]
32508 #[doc = ""]
32509 #[doc = "ID: 340"]
32510 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
32511 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
32512 #[doc = ""]
32513 #[doc = "ID: 248"]
32514 V2_EXTENSION(V2_EXTENSION_DATA),
32515 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
32516 #[doc = ""]
32517 #[doc = "ID: 74"]
32518 VFR_HUD(VFR_HUD_DATA),
32519 #[doc = "Vibration levels and accelerometer clipping."]
32520 #[doc = ""]
32521 #[doc = "ID: 241"]
32522 VIBRATION(VIBRATION_DATA),
32523 #[doc = "Global position estimate from a Vicon motion system source."]
32524 #[doc = ""]
32525 #[doc = "ID: 104"]
32526 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
32527 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
32528 #[doc = ""]
32529 #[doc = "ID: 269"]
32530 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
32531 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
32532 #[doc = ""]
32533 #[doc = "ID: 270"]
32534 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
32535 #[doc = "Local position/attitude estimate from a vision source."]
32536 #[doc = ""]
32537 #[doc = "ID: 102"]
32538 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
32539 #[doc = "Speed estimate from a vision source."]
32540 #[doc = ""]
32541 #[doc = "ID: 103"]
32542 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
32543 #[doc = "Cumulative distance traveled for each reported wheel."]
32544 #[doc = ""]
32545 #[doc = "ID: 9000"]
32546 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
32547 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32548 #[doc = ""]
32549 #[doc = "ID: 299"]
32550 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
32551 #[doc = "Winch status."]
32552 #[doc = ""]
32553 #[doc = "ID: 9005"]
32554 WINCH_STATUS(WINCH_STATUS_DATA),
32555 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
32556 #[doc = ""]
32557 #[doc = "ID: 231"]
32558 WIND_COV(WIND_COV_DATA),
32559}
32560impl MavMessage {
32561 pub const fn all_ids() -> &'static [u32] {
32562 &[
32563 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
32564 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
32565 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
32566 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
32567 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
32568 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
32569 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
32570 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
32571 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
32572 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
32573 148u32, 149u32, 162u32, 180u32, 181u32, 182u32, 183u32, 184u32, 192u32, 225u32, 230u32,
32574 231u32, 232u32, 233u32, 234u32, 235u32, 241u32, 242u32, 243u32, 244u32, 245u32, 246u32,
32575 247u32, 248u32, 249u32, 250u32, 251u32, 252u32, 253u32, 254u32, 256u32, 257u32, 258u32,
32576 259u32, 260u32, 261u32, 262u32, 263u32, 264u32, 265u32, 266u32, 267u32, 268u32, 269u32,
32577 270u32, 271u32, 275u32, 276u32, 277u32, 280u32, 281u32, 282u32, 283u32, 284u32, 285u32,
32578 286u32, 287u32, 288u32, 290u32, 291u32, 299u32, 300u32, 301u32, 310u32, 311u32, 320u32,
32579 321u32, 322u32, 323u32, 324u32, 330u32, 331u32, 332u32, 333u32, 334u32, 335u32, 336u32,
32580 339u32, 340u32, 350u32, 360u32, 370u32, 371u32, 372u32, 373u32, 375u32, 380u32, 385u32,
32581 386u32, 387u32, 388u32, 390u32, 395u32, 396u32, 397u32, 400u32, 401u32, 410u32, 411u32,
32582 412u32, 413u32, 435u32, 436u32, 437u32, 440u32, 9000u32, 9005u32, 12900u32, 12901u32,
32583 12902u32, 12903u32, 12904u32, 12905u32, 12915u32, 12918u32, 12919u32, 12920u32,
32584 ]
32585 }
32586}
32587impl Message for MavMessage {
32588 fn parse(
32589 version: MavlinkVersion,
32590 id: u32,
32591 payload: &[u8],
32592 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32593 match id {
32594 ACTUATOR_CONTROL_TARGET_DATA::ID => {
32595 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
32596 .map(Self::ACTUATOR_CONTROL_TARGET)
32597 }
32598 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
32599 .map(Self::ACTUATOR_OUTPUT_STATUS),
32600 ADSB_VEHICLE_DATA::ID => {
32601 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
32602 }
32603 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
32604 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
32605 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
32606 ATTITUDE_QUATERNION_DATA::ID => {
32607 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
32608 }
32609 ATTITUDE_QUATERNION_COV_DATA::ID => {
32610 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
32611 .map(Self::ATTITUDE_QUATERNION_COV)
32612 }
32613 ATTITUDE_TARGET_DATA::ID => {
32614 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
32615 }
32616 ATT_POS_MOCAP_DATA::ID => {
32617 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
32618 }
32619 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
32620 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
32621 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
32622 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
32623 }
32624 AUTOPILOT_VERSION_DATA::ID => {
32625 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
32626 }
32627 AVAILABLE_MODES_DATA::ID => {
32628 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
32629 }
32630 AVAILABLE_MODES_MONITOR_DATA::ID => {
32631 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
32632 .map(Self::AVAILABLE_MODES_MONITOR)
32633 }
32634 BATTERY_INFO_DATA::ID => {
32635 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
32636 }
32637 BATTERY_STATUS_DATA::ID => {
32638 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
32639 }
32640 BUTTON_CHANGE_DATA::ID => {
32641 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
32642 }
32643 CAMERA_CAPTURE_STATUS_DATA::ID => {
32644 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
32645 }
32646 CAMERA_FOV_STATUS_DATA::ID => {
32647 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
32648 }
32649 CAMERA_IMAGE_CAPTURED_DATA::ID => {
32650 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
32651 }
32652 CAMERA_INFORMATION_DATA::ID => {
32653 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
32654 }
32655 CAMERA_SETTINGS_DATA::ID => {
32656 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
32657 }
32658 CAMERA_THERMAL_RANGE_DATA::ID => {
32659 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
32660 }
32661 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
32662 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
32663 .map(Self::CAMERA_TRACKING_GEO_STATUS)
32664 }
32665 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
32666 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
32667 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
32668 }
32669 CAMERA_TRIGGER_DATA::ID => {
32670 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
32671 }
32672 CANFD_FRAME_DATA::ID => {
32673 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
32674 }
32675 CAN_FILTER_MODIFY_DATA::ID => {
32676 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
32677 }
32678 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
32679 CELLULAR_CONFIG_DATA::ID => {
32680 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
32681 }
32682 CELLULAR_STATUS_DATA::ID => {
32683 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
32684 }
32685 CHANGE_OPERATOR_CONTROL_DATA::ID => {
32686 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
32687 .map(Self::CHANGE_OPERATOR_CONTROL)
32688 }
32689 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
32690 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
32691 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
32692 }
32693 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
32694 COMMAND_ACK_DATA::ID => {
32695 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
32696 }
32697 COMMAND_CANCEL_DATA::ID => {
32698 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
32699 }
32700 COMMAND_INT_DATA::ID => {
32701 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
32702 }
32703 COMMAND_LONG_DATA::ID => {
32704 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
32705 }
32706 COMPONENT_INFORMATION_DATA::ID => {
32707 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
32708 }
32709 COMPONENT_INFORMATION_BASIC_DATA::ID => {
32710 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
32711 .map(Self::COMPONENT_INFORMATION_BASIC)
32712 }
32713 COMPONENT_METADATA_DATA::ID => {
32714 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
32715 }
32716 CONTROL_SYSTEM_STATE_DATA::ID => {
32717 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
32718 }
32719 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
32720 .map(Self::CURRENT_EVENT_SEQUENCE),
32721 CURRENT_MODE_DATA::ID => {
32722 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
32723 }
32724 DATA_STREAM_DATA::ID => {
32725 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
32726 }
32727 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
32728 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
32729 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
32730 }
32731 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
32732 DEBUG_FLOAT_ARRAY_DATA::ID => {
32733 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
32734 }
32735 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
32736 DISTANCE_SENSOR_DATA::ID => {
32737 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
32738 }
32739 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
32740 ENCAPSULATED_DATA_DATA::ID => {
32741 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
32742 }
32743 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
32744 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
32745 ESTIMATOR_STATUS_DATA::ID => {
32746 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
32747 }
32748 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
32749 EXTENDED_SYS_STATE_DATA::ID => {
32750 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
32751 }
32752 FENCE_STATUS_DATA::ID => {
32753 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
32754 }
32755 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
32756 .map(Self::FILE_TRANSFER_PROTOCOL),
32757 FLIGHT_INFORMATION_DATA::ID => {
32758 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
32759 }
32760 FOLLOW_TARGET_DATA::ID => {
32761 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
32762 }
32763 FUEL_STATUS_DATA::ID => {
32764 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
32765 }
32766 GENERATOR_STATUS_DATA::ID => {
32767 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
32768 }
32769 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
32770 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
32771 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
32772 }
32773 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
32774 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
32775 .map(Self::GIMBAL_DEVICE_INFORMATION)
32776 }
32777 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
32778 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
32779 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
32780 }
32781 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
32782 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
32783 .map(Self::GIMBAL_MANAGER_INFORMATION)
32784 }
32785 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
32786 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
32787 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
32788 }
32789 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
32790 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
32791 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
32792 }
32793 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
32794 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
32795 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
32796 }
32797 GIMBAL_MANAGER_STATUS_DATA::ID => {
32798 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
32799 }
32800 GLOBAL_POSITION_INT_DATA::ID => {
32801 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
32802 }
32803 GLOBAL_POSITION_INT_COV_DATA::ID => {
32804 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
32805 .map(Self::GLOBAL_POSITION_INT_COV)
32806 }
32807 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
32808 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
32809 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
32810 }
32811 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
32812 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
32813 GPS_GLOBAL_ORIGIN_DATA::ID => {
32814 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
32815 }
32816 GPS_INJECT_DATA_DATA::ID => {
32817 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
32818 }
32819 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
32820 GPS_RAW_INT_DATA::ID => {
32821 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
32822 }
32823 GPS_RTCM_DATA_DATA::ID => {
32824 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
32825 }
32826 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
32827 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
32828 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
32829 HIGHRES_IMU_DATA::ID => {
32830 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
32831 }
32832 HIGH_LATENCY_DATA::ID => {
32833 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
32834 }
32835 HIGH_LATENCY2_DATA::ID => {
32836 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
32837 }
32838 HIL_ACTUATOR_CONTROLS_DATA::ID => {
32839 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
32840 }
32841 HIL_CONTROLS_DATA::ID => {
32842 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
32843 }
32844 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
32845 HIL_OPTICAL_FLOW_DATA::ID => {
32846 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
32847 }
32848 HIL_RC_INPUTS_RAW_DATA::ID => {
32849 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
32850 }
32851 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
32852 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
32853 HIL_STATE_QUATERNION_DATA::ID => {
32854 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
32855 }
32856 HOME_POSITION_DATA::ID => {
32857 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
32858 }
32859 HYGROMETER_SENSOR_DATA::ID => {
32860 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
32861 }
32862 ILLUMINATOR_STATUS_DATA::ID => {
32863 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
32864 }
32865 ISBD_LINK_STATUS_DATA::ID => {
32866 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
32867 }
32868 LANDING_TARGET_DATA::ID => {
32869 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
32870 }
32871 LINK_NODE_STATUS_DATA::ID => {
32872 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
32873 }
32874 LOCAL_POSITION_NED_DATA::ID => {
32875 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
32876 }
32877 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
32878 .map(Self::LOCAL_POSITION_NED_COV),
32879 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
32880 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
32881 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
32882 }
32883 LOGGING_ACK_DATA::ID => {
32884 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
32885 }
32886 LOGGING_DATA_DATA::ID => {
32887 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
32888 }
32889 LOGGING_DATA_ACKED_DATA::ID => {
32890 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
32891 }
32892 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
32893 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
32894 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
32895 LOG_REQUEST_DATA_DATA::ID => {
32896 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
32897 }
32898 LOG_REQUEST_END_DATA::ID => {
32899 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
32900 }
32901 LOG_REQUEST_LIST_DATA::ID => {
32902 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
32903 }
32904 MAG_CAL_REPORT_DATA::ID => {
32905 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
32906 }
32907 MANUAL_CONTROL_DATA::ID => {
32908 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
32909 }
32910 MANUAL_SETPOINT_DATA::ID => {
32911 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
32912 }
32913 MEMORY_VECT_DATA::ID => {
32914 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
32915 }
32916 MESSAGE_INTERVAL_DATA::ID => {
32917 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
32918 }
32919 MISSION_ACK_DATA::ID => {
32920 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
32921 }
32922 MISSION_CLEAR_ALL_DATA::ID => {
32923 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
32924 }
32925 MISSION_COUNT_DATA::ID => {
32926 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
32927 }
32928 MISSION_CURRENT_DATA::ID => {
32929 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
32930 }
32931 MISSION_ITEM_DATA::ID => {
32932 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
32933 }
32934 MISSION_ITEM_INT_DATA::ID => {
32935 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
32936 }
32937 MISSION_ITEM_REACHED_DATA::ID => {
32938 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
32939 }
32940 MISSION_REQUEST_DATA::ID => {
32941 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
32942 }
32943 MISSION_REQUEST_INT_DATA::ID => {
32944 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
32945 }
32946 MISSION_REQUEST_LIST_DATA::ID => {
32947 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
32948 }
32949 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
32950 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
32951 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
32952 }
32953 MISSION_SET_CURRENT_DATA::ID => {
32954 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
32955 }
32956 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
32957 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
32958 .map(Self::MISSION_WRITE_PARTIAL_LIST)
32959 }
32960 MOUNT_ORIENTATION_DATA::ID => {
32961 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
32962 }
32963 NAMED_VALUE_FLOAT_DATA::ID => {
32964 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
32965 }
32966 NAMED_VALUE_INT_DATA::ID => {
32967 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
32968 }
32969 NAV_CONTROLLER_OUTPUT_DATA::ID => {
32970 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
32971 }
32972 OBSTACLE_DISTANCE_DATA::ID => {
32973 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
32974 }
32975 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
32976 ONBOARD_COMPUTER_STATUS_DATA::ID => {
32977 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
32978 .map(Self::ONBOARD_COMPUTER_STATUS)
32979 }
32980 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
32981 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
32982 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
32983 }
32984 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
32985 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
32986 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
32987 }
32988 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
32989 .map(Self::OPEN_DRONE_ID_BASIC_ID),
32990 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
32991 .map(Self::OPEN_DRONE_ID_LOCATION),
32992 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
32993 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
32994 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
32995 }
32996 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
32997 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
32998 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
32999 }
33000 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
33001 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
33002 }
33003 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
33004 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
33005 }
33006 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
33007 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
33008 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
33009 }
33010 OPTICAL_FLOW_DATA::ID => {
33011 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
33012 }
33013 OPTICAL_FLOW_RAD_DATA::ID => {
33014 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
33015 }
33016 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
33017 .map(Self::ORBIT_EXECUTION_STATUS),
33018 PARAM_EXT_ACK_DATA::ID => {
33019 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
33020 }
33021 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
33022 .map(Self::PARAM_EXT_REQUEST_LIST),
33023 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
33024 .map(Self::PARAM_EXT_REQUEST_READ),
33025 PARAM_EXT_SET_DATA::ID => {
33026 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
33027 }
33028 PARAM_EXT_VALUE_DATA::ID => {
33029 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
33030 }
33031 PARAM_MAP_RC_DATA::ID => {
33032 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
33033 }
33034 PARAM_REQUEST_LIST_DATA::ID => {
33035 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
33036 }
33037 PARAM_REQUEST_READ_DATA::ID => {
33038 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
33039 }
33040 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
33041 PARAM_VALUE_DATA::ID => {
33042 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
33043 }
33044 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
33045 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
33046 PLAY_TUNE_V2_DATA::ID => {
33047 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
33048 }
33049 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33050 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33051 .map(Self::POSITION_TARGET_GLOBAL_INT)
33052 }
33053 POSITION_TARGET_LOCAL_NED_DATA::ID => {
33054 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33055 .map(Self::POSITION_TARGET_LOCAL_NED)
33056 }
33057 POWER_STATUS_DATA::ID => {
33058 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
33059 }
33060 PROTOCOL_VERSION_DATA::ID => {
33061 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
33062 }
33063 RADIO_STATUS_DATA::ID => {
33064 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
33065 }
33066 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
33067 RAW_PRESSURE_DATA::ID => {
33068 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
33069 }
33070 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
33071 RC_CHANNELS_DATA::ID => {
33072 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
33073 }
33074 RC_CHANNELS_OVERRIDE_DATA::ID => {
33075 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
33076 }
33077 RC_CHANNELS_RAW_DATA::ID => {
33078 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
33079 }
33080 RC_CHANNELS_SCALED_DATA::ID => {
33081 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
33082 }
33083 REQUEST_DATA_STREAM_DATA::ID => {
33084 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
33085 }
33086 REQUEST_EVENT_DATA::ID => {
33087 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
33088 }
33089 RESOURCE_REQUEST_DATA::ID => {
33090 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
33091 }
33092 RESPONSE_EVENT_ERROR_DATA::ID => {
33093 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
33094 }
33095 SAFETY_ALLOWED_AREA_DATA::ID => {
33096 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
33097 }
33098 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
33099 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
33100 .map(Self::SAFETY_SET_ALLOWED_AREA)
33101 }
33102 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
33103 SCALED_IMU2_DATA::ID => {
33104 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
33105 }
33106 SCALED_IMU3_DATA::ID => {
33107 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
33108 }
33109 SCALED_PRESSURE_DATA::ID => {
33110 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
33111 }
33112 SCALED_PRESSURE2_DATA::ID => {
33113 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
33114 }
33115 SCALED_PRESSURE3_DATA::ID => {
33116 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
33117 }
33118 SCRIPT_COUNT_DATA::ID => {
33119 SCRIPT_COUNT_DATA::deser(version, payload).map(Self::SCRIPT_COUNT)
33120 }
33121 SCRIPT_CURRENT_DATA::ID => {
33122 SCRIPT_CURRENT_DATA::deser(version, payload).map(Self::SCRIPT_CURRENT)
33123 }
33124 SCRIPT_ITEM_DATA::ID => {
33125 SCRIPT_ITEM_DATA::deser(version, payload).map(Self::SCRIPT_ITEM)
33126 }
33127 SCRIPT_REQUEST_DATA::ID => {
33128 SCRIPT_REQUEST_DATA::deser(version, payload).map(Self::SCRIPT_REQUEST)
33129 }
33130 SCRIPT_REQUEST_LIST_DATA::ID => {
33131 SCRIPT_REQUEST_LIST_DATA::deser(version, payload).map(Self::SCRIPT_REQUEST_LIST)
33132 }
33133 SERIAL_CONTROL_DATA::ID => {
33134 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
33135 }
33136 SERVO_OUTPUT_RAW_DATA::ID => {
33137 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
33138 }
33139 SETUP_SIGNING_DATA::ID => {
33140 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
33141 }
33142 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
33143 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33144 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
33145 }
33146 SET_ATTITUDE_TARGET_DATA::ID => {
33147 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
33148 }
33149 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
33150 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
33151 }
33152 SET_HOME_POSITION_DATA::ID => {
33153 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
33154 }
33155 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
33156 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33157 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33158 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
33159 }
33160 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
33161 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33162 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
33163 }
33164 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
33165 SMART_BATTERY_INFO_DATA::ID => {
33166 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
33167 }
33168 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
33169 STORAGE_INFORMATION_DATA::ID => {
33170 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
33171 }
33172 SUPPORTED_TUNES_DATA::ID => {
33173 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
33174 }
33175 SYSTEM_TIME_DATA::ID => {
33176 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
33177 }
33178 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
33179 TERRAIN_CHECK_DATA::ID => {
33180 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
33181 }
33182 TERRAIN_DATA_DATA::ID => {
33183 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
33184 }
33185 TERRAIN_REPORT_DATA::ID => {
33186 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
33187 }
33188 TERRAIN_REQUEST_DATA::ID => {
33189 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
33190 }
33191 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
33192 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
33193 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
33194 .map(Self::TIME_ESTIMATE_TO_TARGET)
33195 }
33196 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
33197 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
33198 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
33199 }
33200 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
33201 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
33202 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
33203 }
33204 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
33205 UAVCAN_NODE_INFO_DATA::ID => {
33206 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
33207 }
33208 UAVCAN_NODE_STATUS_DATA::ID => {
33209 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
33210 }
33211 UTM_GLOBAL_POSITION_DATA::ID => {
33212 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
33213 }
33214 V2_EXTENSION_DATA::ID => {
33215 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
33216 }
33217 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
33218 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
33219 VICON_POSITION_ESTIMATE_DATA::ID => {
33220 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
33221 .map(Self::VICON_POSITION_ESTIMATE)
33222 }
33223 VIDEO_STREAM_INFORMATION_DATA::ID => {
33224 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
33225 .map(Self::VIDEO_STREAM_INFORMATION)
33226 }
33227 VIDEO_STREAM_STATUS_DATA::ID => {
33228 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
33229 }
33230 VISION_POSITION_ESTIMATE_DATA::ID => {
33231 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
33232 .map(Self::VISION_POSITION_ESTIMATE)
33233 }
33234 VISION_SPEED_ESTIMATE_DATA::ID => {
33235 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
33236 }
33237 WHEEL_DISTANCE_DATA::ID => {
33238 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
33239 }
33240 WIFI_CONFIG_AP_DATA::ID => {
33241 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
33242 }
33243 WINCH_STATUS_DATA::ID => {
33244 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
33245 }
33246 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
33247 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
33248 }
33249 }
33250 fn message_name(&self) -> &'static str {
33251 match self {
33252 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
33253 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
33254 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
33255 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
33256 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
33257 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
33258 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
33259 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
33260 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
33261 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
33262 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
33263 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
33264 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
33265 }
33266 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
33267 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
33268 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
33269 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
33270 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
33271 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
33272 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
33273 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
33274 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
33275 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
33276 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
33277 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
33278 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
33279 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
33280 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
33281 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
33282 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
33283 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
33284 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
33285 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
33286 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
33287 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
33288 Self::COLLISION(..) => COLLISION_DATA::NAME,
33289 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
33290 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
33291 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
33292 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
33293 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
33294 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
33295 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
33296 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
33297 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
33298 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
33299 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
33300 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
33301 Self::DEBUG(..) => DEBUG_DATA::NAME,
33302 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
33303 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
33304 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
33305 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
33306 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
33307 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
33308 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
33309 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
33310 Self::EVENT(..) => EVENT_DATA::NAME,
33311 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
33312 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
33313 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
33314 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
33315 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
33316 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
33317 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
33318 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
33319 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
33320 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
33321 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
33322 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
33323 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
33324 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
33325 }
33326 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
33327 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
33328 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
33329 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
33330 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
33331 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
33332 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
33333 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
33334 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
33335 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
33336 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
33337 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
33338 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
33339 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
33340 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
33341 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
33342 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
33343 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
33344 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
33345 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
33346 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
33347 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
33348 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
33349 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
33350 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
33351 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
33352 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
33353 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
33354 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
33355 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
33356 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
33357 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
33358 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
33359 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
33360 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
33361 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
33362 }
33363 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
33364 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
33365 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
33366 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
33367 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
33368 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
33369 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
33370 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
33371 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
33372 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
33373 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
33374 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
33375 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
33376 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
33377 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
33378 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
33379 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
33380 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
33381 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
33382 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
33383 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
33384 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
33385 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
33386 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
33387 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
33388 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
33389 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
33390 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
33391 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
33392 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
33393 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
33394 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
33395 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
33396 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
33397 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
33398 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
33399 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
33400 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
33401 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
33402 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
33403 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
33404 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
33405 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
33406 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
33407 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
33408 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
33409 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
33410 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
33411 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
33412 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
33413 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
33414 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
33415 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
33416 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
33417 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
33418 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
33419 Self::PING(..) => PING_DATA::NAME,
33420 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
33421 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
33422 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
33423 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
33424 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
33425 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
33426 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
33427 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
33428 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
33429 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
33430 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
33431 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
33432 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
33433 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
33434 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
33435 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
33436 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
33437 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
33438 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
33439 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
33440 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
33441 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
33442 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
33443 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
33444 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
33445 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
33446 Self::SCRIPT_COUNT(..) => SCRIPT_COUNT_DATA::NAME,
33447 Self::SCRIPT_CURRENT(..) => SCRIPT_CURRENT_DATA::NAME,
33448 Self::SCRIPT_ITEM(..) => SCRIPT_ITEM_DATA::NAME,
33449 Self::SCRIPT_REQUEST(..) => SCRIPT_REQUEST_DATA::NAME,
33450 Self::SCRIPT_REQUEST_LIST(..) => SCRIPT_REQUEST_LIST_DATA::NAME,
33451 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
33452 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
33453 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
33454 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
33455 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
33456 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
33457 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
33458 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
33459 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
33460 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
33461 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
33462 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
33463 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
33464 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
33465 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
33466 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
33467 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
33468 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
33469 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
33470 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
33471 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
33472 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
33473 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
33474 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
33475 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
33476 }
33477 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
33478 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
33479 }
33480 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
33481 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
33482 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
33483 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
33484 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
33485 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
33486 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
33487 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
33488 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
33489 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
33490 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
33491 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
33492 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
33493 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
33494 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
33495 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
33496 }
33497 }
33498 fn message_id(&self) -> u32 {
33499 match self {
33500 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
33501 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
33502 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
33503 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
33504 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
33505 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
33506 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
33507 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
33508 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
33509 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
33510 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
33511 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
33512 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
33513 }
33514 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
33515 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
33516 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
33517 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
33518 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
33519 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
33520 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
33521 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
33522 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
33523 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
33524 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
33525 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
33526 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
33527 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
33528 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
33529 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
33530 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
33531 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
33532 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
33533 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
33534 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
33535 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
33536 Self::COLLISION(..) => COLLISION_DATA::ID,
33537 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
33538 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
33539 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
33540 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
33541 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
33542 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
33543 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
33544 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
33545 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
33546 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
33547 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
33548 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
33549 Self::DEBUG(..) => DEBUG_DATA::ID,
33550 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
33551 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
33552 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
33553 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
33554 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
33555 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
33556 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
33557 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
33558 Self::EVENT(..) => EVENT_DATA::ID,
33559 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
33560 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
33561 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
33562 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
33563 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
33564 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
33565 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
33566 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
33567 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
33568 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
33569 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
33570 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
33571 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
33572 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
33573 }
33574 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
33575 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
33576 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
33577 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
33578 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
33579 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
33580 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
33581 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
33582 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
33583 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
33584 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
33585 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
33586 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
33587 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
33588 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
33589 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
33590 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
33591 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
33592 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
33593 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
33594 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
33595 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
33596 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
33597 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
33598 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
33599 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
33600 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
33601 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
33602 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
33603 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
33604 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
33605 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
33606 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
33607 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
33608 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
33609 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
33610 }
33611 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
33612 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
33613 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
33614 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
33615 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
33616 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
33617 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
33618 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
33619 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
33620 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
33621 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
33622 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
33623 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
33624 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
33625 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
33626 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
33627 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
33628 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
33629 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
33630 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
33631 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
33632 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
33633 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
33634 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
33635 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
33636 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
33637 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
33638 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
33639 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
33640 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
33641 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
33642 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
33643 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
33644 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
33645 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
33646 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
33647 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
33648 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
33649 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
33650 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
33651 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
33652 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
33653 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
33654 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
33655 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
33656 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
33657 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
33658 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
33659 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
33660 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
33661 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
33662 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
33663 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
33664 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
33665 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
33666 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
33667 Self::PING(..) => PING_DATA::ID,
33668 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
33669 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
33670 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
33671 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
33672 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
33673 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
33674 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
33675 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
33676 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
33677 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
33678 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
33679 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
33680 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
33681 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
33682 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
33683 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
33684 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
33685 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
33686 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
33687 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
33688 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
33689 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
33690 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
33691 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
33692 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
33693 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
33694 Self::SCRIPT_COUNT(..) => SCRIPT_COUNT_DATA::ID,
33695 Self::SCRIPT_CURRENT(..) => SCRIPT_CURRENT_DATA::ID,
33696 Self::SCRIPT_ITEM(..) => SCRIPT_ITEM_DATA::ID,
33697 Self::SCRIPT_REQUEST(..) => SCRIPT_REQUEST_DATA::ID,
33698 Self::SCRIPT_REQUEST_LIST(..) => SCRIPT_REQUEST_LIST_DATA::ID,
33699 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
33700 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
33701 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
33702 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
33703 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
33704 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
33705 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
33706 Self::SET_MODE(..) => SET_MODE_DATA::ID,
33707 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
33708 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
33709 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
33710 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
33711 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
33712 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
33713 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
33714 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
33715 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
33716 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
33717 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
33718 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
33719 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
33720 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
33721 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
33722 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
33723 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
33724 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
33725 }
33726 Self::TUNNEL(..) => TUNNEL_DATA::ID,
33727 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
33728 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
33729 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
33730 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
33731 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
33732 Self::VIBRATION(..) => VIBRATION_DATA::ID,
33733 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
33734 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
33735 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
33736 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
33737 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
33738 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
33739 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
33740 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
33741 Self::WIND_COV(..) => WIND_COV_DATA::ID,
33742 }
33743 }
33744 fn message_id_from_name(name: &str) -> Option<u32> {
33745 match name {
33746 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
33747 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
33748 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
33749 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
33750 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
33751 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
33752 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
33753 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
33754 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
33755 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
33756 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
33757 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
33758 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
33759 }
33760 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
33761 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
33762 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
33763 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
33764 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
33765 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
33766 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
33767 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
33768 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
33769 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
33770 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
33771 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
33772 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
33773 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
33774 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
33775 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
33776 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
33777 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
33778 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
33779 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
33780 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
33781 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
33782 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
33783 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
33784 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
33785 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
33786 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
33787 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
33788 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
33789 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
33790 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
33791 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
33792 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
33793 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
33794 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
33795 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
33796 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
33797 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
33798 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
33799 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
33800 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
33801 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
33802 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
33803 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
33804 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
33805 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
33806 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
33807 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
33808 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
33809 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
33810 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
33811 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
33812 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
33813 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
33814 }
33815 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
33816 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
33817 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
33818 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
33819 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
33820 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
33821 }
33822 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
33823 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
33824 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
33825 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
33826 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
33827 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
33828 }
33829 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
33830 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
33831 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
33832 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
33833 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
33834 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
33835 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
33836 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
33837 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
33838 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
33839 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
33840 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
33841 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
33842 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
33843 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
33844 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
33845 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
33846 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
33847 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
33848 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
33849 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
33850 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
33851 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
33852 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
33853 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
33854 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
33855 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
33856 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
33857 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
33858 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
33859 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
33860 }
33861 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
33862 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
33863 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
33864 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
33865 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
33866 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
33867 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
33868 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
33869 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
33870 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
33871 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
33872 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
33873 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
33874 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
33875 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
33876 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
33877 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
33878 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
33879 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
33880 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
33881 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
33882 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
33883 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
33884 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
33885 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
33886 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
33887 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
33888 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
33889 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
33890 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
33891 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
33892 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
33893 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
33894 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
33895 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
33896 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
33897 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
33898 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
33899 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
33900 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
33901 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
33902 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
33903 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
33904 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
33905 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
33906 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
33907 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
33908 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
33909 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
33910 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
33911 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
33912 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
33913 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
33914 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
33915 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
33916 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
33917 PING_DATA::NAME => Some(PING_DATA::ID),
33918 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
33919 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
33920 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
33921 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
33922 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
33923 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
33924 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
33925 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
33926 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
33927 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
33928 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
33929 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
33930 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
33931 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
33932 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
33933 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
33934 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
33935 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
33936 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
33937 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
33938 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
33939 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
33940 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
33941 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
33942 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
33943 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
33944 SCRIPT_COUNT_DATA::NAME => Some(SCRIPT_COUNT_DATA::ID),
33945 SCRIPT_CURRENT_DATA::NAME => Some(SCRIPT_CURRENT_DATA::ID),
33946 SCRIPT_ITEM_DATA::NAME => Some(SCRIPT_ITEM_DATA::ID),
33947 SCRIPT_REQUEST_DATA::NAME => Some(SCRIPT_REQUEST_DATA::ID),
33948 SCRIPT_REQUEST_LIST_DATA::NAME => Some(SCRIPT_REQUEST_LIST_DATA::ID),
33949 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
33950 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
33951 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
33952 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
33953 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
33954 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
33955 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
33956 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
33957 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
33958 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
33959 }
33960 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
33961 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
33962 }
33963 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
33964 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
33965 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
33966 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
33967 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
33968 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
33969 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
33970 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
33971 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
33972 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
33973 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
33974 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
33975 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
33976 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
33977 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
33978 }
33979 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
33980 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
33981 }
33982 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
33983 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
33984 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
33985 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
33986 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
33987 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
33988 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
33989 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
33990 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
33991 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
33992 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
33993 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
33994 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
33995 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
33996 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
33997 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
33998 _ => None,
33999 }
34000 }
34001 fn default_message_from_id(id: u32) -> Option<Self> {
34002 match id {
34003 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34004 ACTUATOR_CONTROL_TARGET_DATA::default(),
34005 )),
34006 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34007 ACTUATOR_OUTPUT_STATUS_DATA::default(),
34008 )),
34009 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
34010 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
34011 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
34012 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
34013 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34014 ATTITUDE_QUATERNION_DATA::default(),
34015 )),
34016 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34017 ATTITUDE_QUATERNION_COV_DATA::default(),
34018 )),
34019 ATTITUDE_TARGET_DATA::ID => {
34020 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
34021 }
34022 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
34023 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
34024 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34025 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34026 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
34027 ))
34028 }
34029 AUTOPILOT_VERSION_DATA::ID => {
34030 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
34031 }
34032 AVAILABLE_MODES_DATA::ID => {
34033 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
34034 }
34035 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34036 AVAILABLE_MODES_MONITOR_DATA::default(),
34037 )),
34038 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
34039 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
34040 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
34041 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34042 CAMERA_CAPTURE_STATUS_DATA::default(),
34043 )),
34044 CAMERA_FOV_STATUS_DATA::ID => {
34045 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
34046 }
34047 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
34048 CAMERA_IMAGE_CAPTURED_DATA::default(),
34049 )),
34050 CAMERA_INFORMATION_DATA::ID => {
34051 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
34052 }
34053 CAMERA_SETTINGS_DATA::ID => {
34054 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
34055 }
34056 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
34057 CAMERA_THERMAL_RANGE_DATA::default(),
34058 )),
34059 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
34060 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
34061 )),
34062 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
34063 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
34064 )),
34065 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
34066 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
34067 CAN_FILTER_MODIFY_DATA::ID => {
34068 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
34069 }
34070 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
34071 CELLULAR_CONFIG_DATA::ID => {
34072 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
34073 }
34074 CELLULAR_STATUS_DATA::ID => {
34075 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
34076 }
34077 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
34078 CHANGE_OPERATOR_CONTROL_DATA::default(),
34079 )),
34080 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
34081 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
34082 )),
34083 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
34084 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
34085 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
34086 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
34087 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
34088 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
34089 COMPONENT_INFORMATION_DATA::default(),
34090 )),
34091 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
34092 COMPONENT_INFORMATION_BASIC_DATA::default(),
34093 )),
34094 COMPONENT_METADATA_DATA::ID => {
34095 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
34096 }
34097 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
34098 CONTROL_SYSTEM_STATE_DATA::default(),
34099 )),
34100 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
34101 CURRENT_EVENT_SEQUENCE_DATA::default(),
34102 )),
34103 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
34104 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
34105 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
34106 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
34107 )),
34108 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
34109 DEBUG_FLOAT_ARRAY_DATA::ID => {
34110 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
34111 }
34112 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
34113 DISTANCE_SENSOR_DATA::ID => {
34114 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
34115 }
34116 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
34117 ENCAPSULATED_DATA_DATA::ID => {
34118 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
34119 }
34120 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
34121 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
34122 ESTIMATOR_STATUS_DATA::ID => {
34123 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
34124 }
34125 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
34126 EXTENDED_SYS_STATE_DATA::ID => {
34127 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
34128 }
34129 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
34130 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
34131 FILE_TRANSFER_PROTOCOL_DATA::default(),
34132 )),
34133 FLIGHT_INFORMATION_DATA::ID => {
34134 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
34135 }
34136 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
34137 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
34138 GENERATOR_STATUS_DATA::ID => {
34139 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
34140 }
34141 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
34142 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
34143 )),
34144 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
34145 GIMBAL_DEVICE_INFORMATION_DATA::default(),
34146 )),
34147 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
34148 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
34149 )),
34150 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
34151 GIMBAL_MANAGER_INFORMATION_DATA::default(),
34152 )),
34153 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
34154 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
34155 )),
34156 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34157 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
34158 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
34159 ))
34160 }
34161 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
34162 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
34163 )),
34164 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
34165 GIMBAL_MANAGER_STATUS_DATA::default(),
34166 )),
34167 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
34168 GLOBAL_POSITION_INT_DATA::default(),
34169 )),
34170 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
34171 GLOBAL_POSITION_INT_COV_DATA::default(),
34172 )),
34173 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34174 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
34175 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
34176 ))
34177 }
34178 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
34179 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
34180 GPS_GLOBAL_ORIGIN_DATA::ID => {
34181 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
34182 }
34183 GPS_INJECT_DATA_DATA::ID => {
34184 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
34185 }
34186 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
34187 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
34188 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
34189 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
34190 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
34191 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
34192 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
34193 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
34194 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
34195 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
34196 HIL_ACTUATOR_CONTROLS_DATA::default(),
34197 )),
34198 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
34199 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
34200 HIL_OPTICAL_FLOW_DATA::ID => {
34201 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
34202 }
34203 HIL_RC_INPUTS_RAW_DATA::ID => {
34204 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
34205 }
34206 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
34207 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
34208 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
34209 HIL_STATE_QUATERNION_DATA::default(),
34210 )),
34211 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
34212 HYGROMETER_SENSOR_DATA::ID => {
34213 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
34214 }
34215 ILLUMINATOR_STATUS_DATA::ID => {
34216 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
34217 }
34218 ISBD_LINK_STATUS_DATA::ID => {
34219 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
34220 }
34221 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
34222 LINK_NODE_STATUS_DATA::ID => {
34223 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
34224 }
34225 LOCAL_POSITION_NED_DATA::ID => {
34226 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
34227 }
34228 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
34229 LOCAL_POSITION_NED_COV_DATA::default(),
34230 )),
34231 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34232 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
34233 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
34234 ))
34235 }
34236 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
34237 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
34238 LOGGING_DATA_ACKED_DATA::ID => {
34239 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
34240 }
34241 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
34242 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
34243 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
34244 LOG_REQUEST_DATA_DATA::ID => {
34245 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
34246 }
34247 LOG_REQUEST_END_DATA::ID => {
34248 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
34249 }
34250 LOG_REQUEST_LIST_DATA::ID => {
34251 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
34252 }
34253 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
34254 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
34255 MANUAL_SETPOINT_DATA::ID => {
34256 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
34257 }
34258 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
34259 MESSAGE_INTERVAL_DATA::ID => {
34260 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
34261 }
34262 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
34263 MISSION_CLEAR_ALL_DATA::ID => {
34264 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
34265 }
34266 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
34267 MISSION_CURRENT_DATA::ID => {
34268 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
34269 }
34270 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
34271 MISSION_ITEM_INT_DATA::ID => {
34272 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
34273 }
34274 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
34275 MISSION_ITEM_REACHED_DATA::default(),
34276 )),
34277 MISSION_REQUEST_DATA::ID => {
34278 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
34279 }
34280 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
34281 MISSION_REQUEST_INT_DATA::default(),
34282 )),
34283 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
34284 MISSION_REQUEST_LIST_DATA::default(),
34285 )),
34286 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
34287 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
34288 )),
34289 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
34290 MISSION_SET_CURRENT_DATA::default(),
34291 )),
34292 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
34293 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
34294 )),
34295 MOUNT_ORIENTATION_DATA::ID => {
34296 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
34297 }
34298 NAMED_VALUE_FLOAT_DATA::ID => {
34299 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
34300 }
34301 NAMED_VALUE_INT_DATA::ID => {
34302 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
34303 }
34304 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
34305 NAV_CONTROLLER_OUTPUT_DATA::default(),
34306 )),
34307 OBSTACLE_DISTANCE_DATA::ID => {
34308 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
34309 }
34310 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
34311 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
34312 ONBOARD_COMPUTER_STATUS_DATA::default(),
34313 )),
34314 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
34315 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
34316 )),
34317 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
34318 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
34319 )),
34320 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
34321 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
34322 )),
34323 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
34324 OPEN_DRONE_ID_LOCATION_DATA::default(),
34325 )),
34326 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
34327 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
34328 )),
34329 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
34330 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
34331 )),
34332 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
34333 OPEN_DRONE_ID_SELF_ID_DATA::default(),
34334 )),
34335 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
34336 OPEN_DRONE_ID_SYSTEM_DATA::default(),
34337 )),
34338 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
34339 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
34340 )),
34341 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
34342 OPTICAL_FLOW_RAD_DATA::ID => {
34343 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
34344 }
34345 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
34346 ORBIT_EXECUTION_STATUS_DATA::default(),
34347 )),
34348 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
34349 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
34350 PARAM_EXT_REQUEST_LIST_DATA::default(),
34351 )),
34352 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
34353 PARAM_EXT_REQUEST_READ_DATA::default(),
34354 )),
34355 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
34356 PARAM_EXT_VALUE_DATA::ID => {
34357 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
34358 }
34359 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
34360 PARAM_REQUEST_LIST_DATA::ID => {
34361 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
34362 }
34363 PARAM_REQUEST_READ_DATA::ID => {
34364 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
34365 }
34366 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
34367 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
34368 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
34369 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
34370 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
34371 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
34372 POSITION_TARGET_GLOBAL_INT_DATA::default(),
34373 )),
34374 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
34375 POSITION_TARGET_LOCAL_NED_DATA::default(),
34376 )),
34377 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
34378 PROTOCOL_VERSION_DATA::ID => {
34379 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
34380 }
34381 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
34382 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
34383 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
34384 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
34385 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
34386 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
34387 RC_CHANNELS_OVERRIDE_DATA::default(),
34388 )),
34389 RC_CHANNELS_RAW_DATA::ID => {
34390 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
34391 }
34392 RC_CHANNELS_SCALED_DATA::ID => {
34393 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
34394 }
34395 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
34396 REQUEST_DATA_STREAM_DATA::default(),
34397 )),
34398 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
34399 RESOURCE_REQUEST_DATA::ID => {
34400 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
34401 }
34402 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
34403 RESPONSE_EVENT_ERROR_DATA::default(),
34404 )),
34405 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
34406 SAFETY_ALLOWED_AREA_DATA::default(),
34407 )),
34408 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
34409 SAFETY_SET_ALLOWED_AREA_DATA::default(),
34410 )),
34411 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
34412 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
34413 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
34414 SCALED_PRESSURE_DATA::ID => {
34415 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
34416 }
34417 SCALED_PRESSURE2_DATA::ID => {
34418 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
34419 }
34420 SCALED_PRESSURE3_DATA::ID => {
34421 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
34422 }
34423 SCRIPT_COUNT_DATA::ID => Some(Self::SCRIPT_COUNT(SCRIPT_COUNT_DATA::default())),
34424 SCRIPT_CURRENT_DATA::ID => Some(Self::SCRIPT_CURRENT(SCRIPT_CURRENT_DATA::default())),
34425 SCRIPT_ITEM_DATA::ID => Some(Self::SCRIPT_ITEM(SCRIPT_ITEM_DATA::default())),
34426 SCRIPT_REQUEST_DATA::ID => Some(Self::SCRIPT_REQUEST(SCRIPT_REQUEST_DATA::default())),
34427 SCRIPT_REQUEST_LIST_DATA::ID => Some(Self::SCRIPT_REQUEST_LIST(
34428 SCRIPT_REQUEST_LIST_DATA::default(),
34429 )),
34430 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
34431 SERVO_OUTPUT_RAW_DATA::ID => {
34432 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
34433 }
34434 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
34435 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
34436 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
34437 )),
34438 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
34439 SET_ATTITUDE_TARGET_DATA::default(),
34440 )),
34441 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
34442 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
34443 )),
34444 SET_HOME_POSITION_DATA::ID => {
34445 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
34446 }
34447 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
34448 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
34449 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
34450 )),
34451 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
34452 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
34453 )),
34454 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
34455 SMART_BATTERY_INFO_DATA::ID => {
34456 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
34457 }
34458 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
34459 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
34460 STORAGE_INFORMATION_DATA::default(),
34461 )),
34462 SUPPORTED_TUNES_DATA::ID => {
34463 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
34464 }
34465 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
34466 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
34467 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
34468 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
34469 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
34470 TERRAIN_REQUEST_DATA::ID => {
34471 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
34472 }
34473 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
34474 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
34475 TIME_ESTIMATE_TO_TARGET_DATA::default(),
34476 )),
34477 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34478 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
34479 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
34480 ))
34481 }
34482 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34483 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
34484 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
34485 ))
34486 }
34487 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
34488 UAVCAN_NODE_INFO_DATA::ID => {
34489 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
34490 }
34491 UAVCAN_NODE_STATUS_DATA::ID => {
34492 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
34493 }
34494 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
34495 UTM_GLOBAL_POSITION_DATA::default(),
34496 )),
34497 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
34498 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
34499 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
34500 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
34501 VICON_POSITION_ESTIMATE_DATA::default(),
34502 )),
34503 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
34504 VIDEO_STREAM_INFORMATION_DATA::default(),
34505 )),
34506 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
34507 VIDEO_STREAM_STATUS_DATA::default(),
34508 )),
34509 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
34510 VISION_POSITION_ESTIMATE_DATA::default(),
34511 )),
34512 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
34513 VISION_SPEED_ESTIMATE_DATA::default(),
34514 )),
34515 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
34516 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
34517 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
34518 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
34519 _ => None,
34520 }
34521 }
34522 #[cfg(feature = "arbitrary")]
34523 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
34524 match id {
34525 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34526 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
34527 )),
34528 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34529 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
34530 )),
34531 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
34532 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
34533 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
34534 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
34535 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34536 ATTITUDE_QUATERNION_DATA::random(rng),
34537 )),
34538 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34539 ATTITUDE_QUATERNION_COV_DATA::random(rng),
34540 )),
34541 ATTITUDE_TARGET_DATA::ID => {
34542 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
34543 }
34544 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
34545 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
34546 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34547 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34548 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
34549 ))
34550 }
34551 AUTOPILOT_VERSION_DATA::ID => {
34552 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
34553 }
34554 AVAILABLE_MODES_DATA::ID => {
34555 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
34556 }
34557 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34558 AVAILABLE_MODES_MONITOR_DATA::random(rng),
34559 )),
34560 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
34561 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
34562 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
34563 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34564 CAMERA_CAPTURE_STATUS_DATA::random(rng),
34565 )),
34566 CAMERA_FOV_STATUS_DATA::ID => {
34567 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
34568 }
34569 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
34570 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
34571 )),
34572 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
34573 CAMERA_INFORMATION_DATA::random(rng),
34574 )),
34575 CAMERA_SETTINGS_DATA::ID => {
34576 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
34577 }
34578 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
34579 CAMERA_THERMAL_RANGE_DATA::random(rng),
34580 )),
34581 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
34582 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
34583 )),
34584 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
34585 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
34586 )),
34587 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
34588 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
34589 CAN_FILTER_MODIFY_DATA::ID => {
34590 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
34591 }
34592 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
34593 CELLULAR_CONFIG_DATA::ID => {
34594 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
34595 }
34596 CELLULAR_STATUS_DATA::ID => {
34597 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
34598 }
34599 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
34600 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
34601 )),
34602 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
34603 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
34604 )),
34605 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
34606 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
34607 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
34608 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
34609 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
34610 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
34611 COMPONENT_INFORMATION_DATA::random(rng),
34612 )),
34613 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
34614 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
34615 )),
34616 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
34617 COMPONENT_METADATA_DATA::random(rng),
34618 )),
34619 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
34620 CONTROL_SYSTEM_STATE_DATA::random(rng),
34621 )),
34622 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
34623 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
34624 )),
34625 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
34626 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
34627 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
34628 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
34629 )),
34630 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
34631 DEBUG_FLOAT_ARRAY_DATA::ID => {
34632 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
34633 }
34634 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
34635 DISTANCE_SENSOR_DATA::ID => {
34636 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
34637 }
34638 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
34639 ENCAPSULATED_DATA_DATA::ID => {
34640 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
34641 }
34642 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
34643 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
34644 ESTIMATOR_STATUS_DATA::ID => {
34645 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
34646 }
34647 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
34648 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
34649 EXTENDED_SYS_STATE_DATA::random(rng),
34650 )),
34651 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
34652 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
34653 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
34654 )),
34655 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
34656 FLIGHT_INFORMATION_DATA::random(rng),
34657 )),
34658 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
34659 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
34660 GENERATOR_STATUS_DATA::ID => {
34661 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
34662 }
34663 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
34664 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
34665 )),
34666 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
34667 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
34668 )),
34669 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
34670 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
34671 )),
34672 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
34673 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
34674 )),
34675 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
34676 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
34677 )),
34678 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34679 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
34680 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
34681 ))
34682 }
34683 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
34684 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
34685 )),
34686 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
34687 GIMBAL_MANAGER_STATUS_DATA::random(rng),
34688 )),
34689 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
34690 GLOBAL_POSITION_INT_DATA::random(rng),
34691 )),
34692 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
34693 GLOBAL_POSITION_INT_COV_DATA::random(rng),
34694 )),
34695 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34696 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
34697 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
34698 ))
34699 }
34700 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
34701 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
34702 GPS_GLOBAL_ORIGIN_DATA::ID => {
34703 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
34704 }
34705 GPS_INJECT_DATA_DATA::ID => {
34706 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
34707 }
34708 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
34709 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
34710 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
34711 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
34712 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
34713 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
34714 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
34715 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
34716 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
34717 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
34718 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
34719 )),
34720 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
34721 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
34722 HIL_OPTICAL_FLOW_DATA::ID => {
34723 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
34724 }
34725 HIL_RC_INPUTS_RAW_DATA::ID => {
34726 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
34727 }
34728 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
34729 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
34730 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
34731 HIL_STATE_QUATERNION_DATA::random(rng),
34732 )),
34733 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
34734 HYGROMETER_SENSOR_DATA::ID => {
34735 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
34736 }
34737 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
34738 ILLUMINATOR_STATUS_DATA::random(rng),
34739 )),
34740 ISBD_LINK_STATUS_DATA::ID => {
34741 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
34742 }
34743 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
34744 LINK_NODE_STATUS_DATA::ID => {
34745 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
34746 }
34747 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
34748 LOCAL_POSITION_NED_DATA::random(rng),
34749 )),
34750 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
34751 LOCAL_POSITION_NED_COV_DATA::random(rng),
34752 )),
34753 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34754 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
34755 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
34756 ))
34757 }
34758 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
34759 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
34760 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
34761 LOGGING_DATA_ACKED_DATA::random(rng),
34762 )),
34763 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
34764 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
34765 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
34766 LOG_REQUEST_DATA_DATA::ID => {
34767 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
34768 }
34769 LOG_REQUEST_END_DATA::ID => {
34770 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
34771 }
34772 LOG_REQUEST_LIST_DATA::ID => {
34773 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
34774 }
34775 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
34776 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
34777 MANUAL_SETPOINT_DATA::ID => {
34778 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
34779 }
34780 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
34781 MESSAGE_INTERVAL_DATA::ID => {
34782 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
34783 }
34784 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
34785 MISSION_CLEAR_ALL_DATA::ID => {
34786 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
34787 }
34788 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
34789 MISSION_CURRENT_DATA::ID => {
34790 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
34791 }
34792 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
34793 MISSION_ITEM_INT_DATA::ID => {
34794 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
34795 }
34796 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
34797 MISSION_ITEM_REACHED_DATA::random(rng),
34798 )),
34799 MISSION_REQUEST_DATA::ID => {
34800 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
34801 }
34802 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
34803 MISSION_REQUEST_INT_DATA::random(rng),
34804 )),
34805 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
34806 MISSION_REQUEST_LIST_DATA::random(rng),
34807 )),
34808 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
34809 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
34810 )),
34811 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
34812 MISSION_SET_CURRENT_DATA::random(rng),
34813 )),
34814 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
34815 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
34816 )),
34817 MOUNT_ORIENTATION_DATA::ID => {
34818 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
34819 }
34820 NAMED_VALUE_FLOAT_DATA::ID => {
34821 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
34822 }
34823 NAMED_VALUE_INT_DATA::ID => {
34824 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
34825 }
34826 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
34827 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
34828 )),
34829 OBSTACLE_DISTANCE_DATA::ID => {
34830 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
34831 }
34832 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
34833 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
34834 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
34835 )),
34836 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
34837 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
34838 )),
34839 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
34840 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
34841 )),
34842 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
34843 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
34844 )),
34845 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
34846 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
34847 )),
34848 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
34849 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
34850 )),
34851 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
34852 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
34853 )),
34854 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
34855 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
34856 )),
34857 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
34858 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
34859 )),
34860 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
34861 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
34862 )),
34863 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
34864 OPTICAL_FLOW_RAD_DATA::ID => {
34865 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
34866 }
34867 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
34868 ORBIT_EXECUTION_STATUS_DATA::random(rng),
34869 )),
34870 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
34871 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
34872 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
34873 )),
34874 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
34875 PARAM_EXT_REQUEST_READ_DATA::random(rng),
34876 )),
34877 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
34878 PARAM_EXT_VALUE_DATA::ID => {
34879 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
34880 }
34881 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
34882 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
34883 PARAM_REQUEST_LIST_DATA::random(rng),
34884 )),
34885 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
34886 PARAM_REQUEST_READ_DATA::random(rng),
34887 )),
34888 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
34889 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
34890 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
34891 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
34892 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
34893 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
34894 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
34895 )),
34896 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
34897 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
34898 )),
34899 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
34900 PROTOCOL_VERSION_DATA::ID => {
34901 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
34902 }
34903 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
34904 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
34905 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
34906 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
34907 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
34908 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
34909 RC_CHANNELS_OVERRIDE_DATA::random(rng),
34910 )),
34911 RC_CHANNELS_RAW_DATA::ID => {
34912 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
34913 }
34914 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
34915 RC_CHANNELS_SCALED_DATA::random(rng),
34916 )),
34917 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
34918 REQUEST_DATA_STREAM_DATA::random(rng),
34919 )),
34920 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
34921 RESOURCE_REQUEST_DATA::ID => {
34922 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
34923 }
34924 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
34925 RESPONSE_EVENT_ERROR_DATA::random(rng),
34926 )),
34927 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
34928 SAFETY_ALLOWED_AREA_DATA::random(rng),
34929 )),
34930 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
34931 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
34932 )),
34933 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
34934 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
34935 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
34936 SCALED_PRESSURE_DATA::ID => {
34937 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
34938 }
34939 SCALED_PRESSURE2_DATA::ID => {
34940 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
34941 }
34942 SCALED_PRESSURE3_DATA::ID => {
34943 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
34944 }
34945 SCRIPT_COUNT_DATA::ID => Some(Self::SCRIPT_COUNT(SCRIPT_COUNT_DATA::random(rng))),
34946 SCRIPT_CURRENT_DATA::ID => Some(Self::SCRIPT_CURRENT(SCRIPT_CURRENT_DATA::random(rng))),
34947 SCRIPT_ITEM_DATA::ID => Some(Self::SCRIPT_ITEM(SCRIPT_ITEM_DATA::random(rng))),
34948 SCRIPT_REQUEST_DATA::ID => Some(Self::SCRIPT_REQUEST(SCRIPT_REQUEST_DATA::random(rng))),
34949 SCRIPT_REQUEST_LIST_DATA::ID => Some(Self::SCRIPT_REQUEST_LIST(
34950 SCRIPT_REQUEST_LIST_DATA::random(rng),
34951 )),
34952 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
34953 SERVO_OUTPUT_RAW_DATA::ID => {
34954 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
34955 }
34956 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
34957 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
34958 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
34959 )),
34960 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
34961 SET_ATTITUDE_TARGET_DATA::random(rng),
34962 )),
34963 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
34964 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
34965 )),
34966 SET_HOME_POSITION_DATA::ID => {
34967 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
34968 }
34969 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
34970 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
34971 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
34972 )),
34973 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
34974 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
34975 )),
34976 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
34977 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
34978 SMART_BATTERY_INFO_DATA::random(rng),
34979 )),
34980 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
34981 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
34982 STORAGE_INFORMATION_DATA::random(rng),
34983 )),
34984 SUPPORTED_TUNES_DATA::ID => {
34985 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
34986 }
34987 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
34988 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
34989 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
34990 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
34991 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
34992 TERRAIN_REQUEST_DATA::ID => {
34993 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
34994 }
34995 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
34996 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
34997 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
34998 )),
34999 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35000 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35001 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
35002 ))
35003 }
35004 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35005 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35006 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
35007 ))
35008 }
35009 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
35010 UAVCAN_NODE_INFO_DATA::ID => {
35011 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
35012 }
35013 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
35014 UAVCAN_NODE_STATUS_DATA::random(rng),
35015 )),
35016 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35017 UTM_GLOBAL_POSITION_DATA::random(rng),
35018 )),
35019 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
35020 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
35021 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
35022 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35023 VICON_POSITION_ESTIMATE_DATA::random(rng),
35024 )),
35025 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35026 VIDEO_STREAM_INFORMATION_DATA::random(rng),
35027 )),
35028 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35029 VIDEO_STREAM_STATUS_DATA::random(rng),
35030 )),
35031 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35032 VISION_POSITION_ESTIMATE_DATA::random(rng),
35033 )),
35034 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35035 VISION_SPEED_ESTIMATE_DATA::random(rng),
35036 )),
35037 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
35038 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
35039 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
35040 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
35041 _ => None,
35042 }
35043 }
35044 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35045 match self {
35046 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35047 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
35048 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
35049 Self::AIS_VESSEL(body) => body.ser(version, bytes),
35050 Self::ALTITUDE(body) => body.ser(version, bytes),
35051 Self::ATTITUDE(body) => body.ser(version, bytes),
35052 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
35053 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
35054 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
35055 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
35056 Self::AUTH_KEY(body) => body.ser(version, bytes),
35057 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
35058 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
35059 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
35060 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
35061 Self::BATTERY_INFO(body) => body.ser(version, bytes),
35062 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
35063 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
35064 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
35065 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
35066 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
35067 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
35068 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
35069 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
35070 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
35071 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
35072 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
35073 Self::CANFD_FRAME(body) => body.ser(version, bytes),
35074 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
35075 Self::CAN_FRAME(body) => body.ser(version, bytes),
35076 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
35077 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
35078 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
35079 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
35080 Self::COLLISION(body) => body.ser(version, bytes),
35081 Self::COMMAND_ACK(body) => body.ser(version, bytes),
35082 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
35083 Self::COMMAND_INT(body) => body.ser(version, bytes),
35084 Self::COMMAND_LONG(body) => body.ser(version, bytes),
35085 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
35086 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
35087 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
35088 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
35089 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
35090 Self::CURRENT_MODE(body) => body.ser(version, bytes),
35091 Self::DATA_STREAM(body) => body.ser(version, bytes),
35092 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
35093 Self::DEBUG(body) => body.ser(version, bytes),
35094 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
35095 Self::DEBUG_VECT(body) => body.ser(version, bytes),
35096 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
35097 Self::EFI_STATUS(body) => body.ser(version, bytes),
35098 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
35099 Self::ESC_INFO(body) => body.ser(version, bytes),
35100 Self::ESC_STATUS(body) => body.ser(version, bytes),
35101 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
35102 Self::EVENT(body) => body.ser(version, bytes),
35103 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
35104 Self::FENCE_STATUS(body) => body.ser(version, bytes),
35105 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
35106 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
35107 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
35108 Self::FUEL_STATUS(body) => body.ser(version, bytes),
35109 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
35110 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
35111 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
35112 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
35113 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
35114 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
35115 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
35116 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
35117 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
35118 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
35119 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
35120 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35121 Self::GPS2_RAW(body) => body.ser(version, bytes),
35122 Self::GPS2_RTK(body) => body.ser(version, bytes),
35123 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
35124 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
35125 Self::GPS_INPUT(body) => body.ser(version, bytes),
35126 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
35127 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
35128 Self::GPS_RTK(body) => body.ser(version, bytes),
35129 Self::GPS_STATUS(body) => body.ser(version, bytes),
35130 Self::HEARTBEAT(body) => body.ser(version, bytes),
35131 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
35132 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
35133 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
35134 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
35135 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
35136 Self::HIL_GPS(body) => body.ser(version, bytes),
35137 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
35138 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
35139 Self::HIL_SENSOR(body) => body.ser(version, bytes),
35140 Self::HIL_STATE(body) => body.ser(version, bytes),
35141 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
35142 Self::HOME_POSITION(body) => body.ser(version, bytes),
35143 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
35144 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
35145 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
35146 Self::LANDING_TARGET(body) => body.ser(version, bytes),
35147 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
35148 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
35149 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
35150 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
35151 Self::LOGGING_ACK(body) => body.ser(version, bytes),
35152 Self::LOGGING_DATA(body) => body.ser(version, bytes),
35153 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
35154 Self::LOG_DATA(body) => body.ser(version, bytes),
35155 Self::LOG_ENTRY(body) => body.ser(version, bytes),
35156 Self::LOG_ERASE(body) => body.ser(version, bytes),
35157 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
35158 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
35159 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
35160 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
35161 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
35162 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
35163 Self::MEMORY_VECT(body) => body.ser(version, bytes),
35164 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
35165 Self::MISSION_ACK(body) => body.ser(version, bytes),
35166 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
35167 Self::MISSION_COUNT(body) => body.ser(version, bytes),
35168 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
35169 Self::MISSION_ITEM(body) => body.ser(version, bytes),
35170 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
35171 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
35172 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
35173 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
35174 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
35175 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
35176 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
35177 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
35178 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
35179 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
35180 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
35181 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
35182 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
35183 Self::ODOMETRY(body) => body.ser(version, bytes),
35184 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
35185 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
35186 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
35187 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
35188 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
35189 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
35190 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
35191 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
35192 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
35193 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
35194 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
35195 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
35196 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
35197 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
35198 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
35199 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
35200 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
35201 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
35202 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
35203 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
35204 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
35205 Self::PARAM_SET(body) => body.ser(version, bytes),
35206 Self::PARAM_VALUE(body) => body.ser(version, bytes),
35207 Self::PING(body) => body.ser(version, bytes),
35208 Self::PLAY_TUNE(body) => body.ser(version, bytes),
35209 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
35210 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
35211 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
35212 Self::POWER_STATUS(body) => body.ser(version, bytes),
35213 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
35214 Self::RADIO_STATUS(body) => body.ser(version, bytes),
35215 Self::RAW_IMU(body) => body.ser(version, bytes),
35216 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
35217 Self::RAW_RPM(body) => body.ser(version, bytes),
35218 Self::RC_CHANNELS(body) => body.ser(version, bytes),
35219 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
35220 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
35221 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
35222 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
35223 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
35224 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
35225 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
35226 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
35227 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
35228 Self::SCALED_IMU(body) => body.ser(version, bytes),
35229 Self::SCALED_IMU2(body) => body.ser(version, bytes),
35230 Self::SCALED_IMU3(body) => body.ser(version, bytes),
35231 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
35232 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
35233 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
35234 Self::SCRIPT_COUNT(body) => body.ser(version, bytes),
35235 Self::SCRIPT_CURRENT(body) => body.ser(version, bytes),
35236 Self::SCRIPT_ITEM(body) => body.ser(version, bytes),
35237 Self::SCRIPT_REQUEST(body) => body.ser(version, bytes),
35238 Self::SCRIPT_REQUEST_LIST(body) => body.ser(version, bytes),
35239 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
35240 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
35241 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
35242 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35243 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
35244 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
35245 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
35246 Self::SET_MODE(body) => body.ser(version, bytes),
35247 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
35248 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
35249 Self::SIM_STATE(body) => body.ser(version, bytes),
35250 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
35251 Self::STATUSTEXT(body) => body.ser(version, bytes),
35252 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
35253 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
35254 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
35255 Self::SYS_STATUS(body) => body.ser(version, bytes),
35256 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
35257 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
35258 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
35259 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
35260 Self::TIMESYNC(body) => body.ser(version, bytes),
35261 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
35262 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
35263 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
35264 Self::TUNNEL(body) => body.ser(version, bytes),
35265 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
35266 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
35267 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
35268 Self::V2_EXTENSION(body) => body.ser(version, bytes),
35269 Self::VFR_HUD(body) => body.ser(version, bytes),
35270 Self::VIBRATION(body) => body.ser(version, bytes),
35271 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35272 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
35273 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
35274 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35275 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
35276 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
35277 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
35278 Self::WINCH_STATUS(body) => body.ser(version, bytes),
35279 Self::WIND_COV(body) => body.ser(version, bytes),
35280 }
35281 }
35282 fn extra_crc(id: u32) -> u8 {
35283 match id {
35284 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
35285 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
35286 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
35287 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
35288 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
35289 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
35290 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
35291 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
35292 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
35293 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
35294 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
35295 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35296 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
35297 }
35298 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
35299 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
35300 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
35301 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
35302 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
35303 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
35304 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
35305 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
35306 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
35307 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
35308 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
35309 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
35310 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
35311 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
35312 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
35313 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
35314 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
35315 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
35316 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
35317 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
35318 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
35319 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
35320 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
35321 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
35322 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
35323 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
35324 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
35325 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
35326 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
35327 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
35328 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
35329 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
35330 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
35331 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
35332 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
35333 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
35334 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
35335 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
35336 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
35337 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
35338 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
35339 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
35340 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
35341 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
35342 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
35343 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
35344 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
35345 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
35346 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
35347 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
35348 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
35349 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
35350 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
35351 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
35352 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
35353 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
35354 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
35355 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35356 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
35357 }
35358 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
35359 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
35360 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
35361 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
35362 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35363 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
35364 }
35365 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
35366 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
35367 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
35368 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
35369 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
35370 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
35371 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
35372 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
35373 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
35374 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
35375 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
35376 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
35377 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
35378 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
35379 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
35380 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
35381 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
35382 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
35383 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
35384 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
35385 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
35386 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
35387 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
35388 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
35389 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
35390 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
35391 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
35392 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
35393 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
35394 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35395 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
35396 }
35397 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
35398 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
35399 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
35400 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
35401 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
35402 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
35403 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
35404 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
35405 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
35406 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
35407 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
35408 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
35409 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
35410 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
35411 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
35412 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
35413 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
35414 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
35415 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
35416 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
35417 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
35418 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
35419 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
35420 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
35421 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
35422 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
35423 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
35424 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
35425 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
35426 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
35427 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
35428 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
35429 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
35430 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
35431 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
35432 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
35433 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
35434 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
35435 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
35436 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
35437 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
35438 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
35439 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
35440 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
35441 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
35442 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
35443 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
35444 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
35445 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
35446 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
35447 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
35448 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
35449 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
35450 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
35451 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
35452 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
35453 PING_DATA::ID => PING_DATA::EXTRA_CRC,
35454 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
35455 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
35456 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
35457 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
35458 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
35459 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
35460 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
35461 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
35462 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
35463 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
35464 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
35465 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
35466 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
35467 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
35468 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
35469 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
35470 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
35471 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
35472 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
35473 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
35474 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
35475 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
35476 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
35477 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
35478 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
35479 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
35480 SCRIPT_COUNT_DATA::ID => SCRIPT_COUNT_DATA::EXTRA_CRC,
35481 SCRIPT_CURRENT_DATA::ID => SCRIPT_CURRENT_DATA::EXTRA_CRC,
35482 SCRIPT_ITEM_DATA::ID => SCRIPT_ITEM_DATA::EXTRA_CRC,
35483 SCRIPT_REQUEST_DATA::ID => SCRIPT_REQUEST_DATA::EXTRA_CRC,
35484 SCRIPT_REQUEST_LIST_DATA::ID => SCRIPT_REQUEST_LIST_DATA::EXTRA_CRC,
35485 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
35486 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
35487 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
35488 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
35489 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
35490 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
35491 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
35492 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
35493 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
35494 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
35495 }
35496 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
35497 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
35498 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
35499 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
35500 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
35501 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
35502 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
35503 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
35504 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
35505 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
35506 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
35507 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
35508 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
35509 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
35510 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35511 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
35512 }
35513 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35514 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
35515 }
35516 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
35517 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
35518 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
35519 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
35520 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
35521 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
35522 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
35523 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
35524 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
35525 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
35526 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
35527 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
35528 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
35529 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
35530 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
35531 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
35532 _ => 0,
35533 }
35534 }
35535 fn target_system_id(&self) -> Option<u8> {
35536 match self {
35537 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
35538 Self::CANFD_FRAME(inner) => Some(inner.target_system),
35539 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
35540 Self::CAN_FRAME(inner) => Some(inner.target_system),
35541 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
35542 Self::COMMAND_ACK(inner) => Some(inner.target_system),
35543 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
35544 Self::COMMAND_INT(inner) => Some(inner.target_system),
35545 Self::COMMAND_LONG(inner) => Some(inner.target_system),
35546 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
35547 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
35548 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
35549 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
35550 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
35551 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
35552 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
35553 Self::LOGGING_ACK(inner) => Some(inner.target_system),
35554 Self::LOGGING_DATA(inner) => Some(inner.target_system),
35555 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
35556 Self::LOG_ERASE(inner) => Some(inner.target_system),
35557 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
35558 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
35559 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
35560 Self::MISSION_ACK(inner) => Some(inner.target_system),
35561 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
35562 Self::MISSION_COUNT(inner) => Some(inner.target_system),
35563 Self::MISSION_ITEM(inner) => Some(inner.target_system),
35564 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
35565 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
35566 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
35567 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
35568 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
35569 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
35570 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
35571 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
35572 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
35573 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
35574 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
35575 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
35576 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
35577 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
35578 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
35579 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
35580 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
35581 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
35582 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
35583 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
35584 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
35585 Self::PARAM_SET(inner) => Some(inner.target_system),
35586 Self::PING(inner) => Some(inner.target_system),
35587 Self::PLAY_TUNE(inner) => Some(inner.target_system),
35588 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
35589 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
35590 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
35591 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
35592 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
35593 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
35594 Self::SCRIPT_COUNT(inner) => Some(inner.target_system),
35595 Self::SCRIPT_ITEM(inner) => Some(inner.target_system),
35596 Self::SCRIPT_REQUEST(inner) => Some(inner.target_system),
35597 Self::SCRIPT_REQUEST_LIST(inner) => Some(inner.target_system),
35598 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
35599 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
35600 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
35601 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
35602 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
35603 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
35604 Self::SET_MODE(inner) => Some(inner.target_system),
35605 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
35606 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
35607 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
35608 Self::TIMESYNC(inner) => Some(inner.target_system),
35609 Self::TUNNEL(inner) => Some(inner.target_system),
35610 Self::V2_EXTENSION(inner) => Some(inner.target_system),
35611 _ => None,
35612 }
35613 }
35614 fn target_component_id(&self) -> Option<u8> {
35615 match self {
35616 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
35617 Self::CANFD_FRAME(inner) => Some(inner.target_component),
35618 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
35619 Self::CAN_FRAME(inner) => Some(inner.target_component),
35620 Self::COMMAND_ACK(inner) => Some(inner.target_component),
35621 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
35622 Self::COMMAND_INT(inner) => Some(inner.target_component),
35623 Self::COMMAND_LONG(inner) => Some(inner.target_component),
35624 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
35625 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
35626 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
35627 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
35628 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
35629 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
35630 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
35631 Self::LOGGING_ACK(inner) => Some(inner.target_component),
35632 Self::LOGGING_DATA(inner) => Some(inner.target_component),
35633 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
35634 Self::LOG_ERASE(inner) => Some(inner.target_component),
35635 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
35636 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
35637 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
35638 Self::MISSION_ACK(inner) => Some(inner.target_component),
35639 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
35640 Self::MISSION_COUNT(inner) => Some(inner.target_component),
35641 Self::MISSION_ITEM(inner) => Some(inner.target_component),
35642 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
35643 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
35644 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
35645 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
35646 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
35647 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
35648 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
35649 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
35650 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
35651 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
35652 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
35653 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
35654 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
35655 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
35656 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
35657 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
35658 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
35659 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
35660 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
35661 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
35662 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
35663 Self::PARAM_SET(inner) => Some(inner.target_component),
35664 Self::PING(inner) => Some(inner.target_component),
35665 Self::PLAY_TUNE(inner) => Some(inner.target_component),
35666 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
35667 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
35668 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
35669 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
35670 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
35671 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
35672 Self::SCRIPT_COUNT(inner) => Some(inner.target_component),
35673 Self::SCRIPT_ITEM(inner) => Some(inner.target_component),
35674 Self::SCRIPT_REQUEST(inner) => Some(inner.target_component),
35675 Self::SCRIPT_REQUEST_LIST(inner) => Some(inner.target_component),
35676 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
35677 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
35678 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
35679 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
35680 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
35681 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
35682 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
35683 Self::TIMESYNC(inner) => Some(inner.target_component),
35684 Self::TUNNEL(inner) => Some(inner.target_component),
35685 Self::V2_EXTENSION(inner) => Some(inner.target_component),
35686 _ => None,
35687 }
35688 }
35689}